[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.sqlserver.programming

equivalent of date() in sql statement

Bart

3/21/2007 4:46:00 PM

Hi,

i'm conerting a asp.net application from Access to Sql server express 2005.
I have problem with cdate() and with date() within the sql string.

My question is : how to translate this query for use with sql server?
sql = "SELECT count(*)" _
& "FROM mytable " _
& "where cdate(anyday)>= date() ;"


Thanks
Bart




10 Answers

Rafael Lenartowicz

3/21/2007 5:05:00 PM

0

there is no "date" data type in SQL Server world, you have to switch over to
datetime datatypes.

"Bart" <baa@qsd.dfv> wrote in message
news:e3ohyh9aHHA.4140@TK2MSFTNGP06.phx.gbl...
> Hi,
>
> i'm conerting a asp.net application from Access to Sql server express
> 2005.
> I have problem with cdate() and with date() within the sql string.
>
> My question is : how to translate this query for use with sql server?
> sql = "SELECT count(*)" _
> & "FROM mytable " _
> & "where cdate(anyday)>= date() ;"
>
>
> Thanks
> Bart
>
>
>
>


Jack Vamvas

3/21/2007 5:07:00 PM

0

Use GETDATE() which would give you the current system and time

--

Jack Vamvas
___________________________________
Advertise your IT vacancies for free at - http://www.ITj...



"Bart" <baa@qsd.dfv> wrote in message
news:e3ohyh9aHHA.4140@TK2MSFTNGP06.phx.gbl...
> Hi,
>
> i'm conerting a asp.net application from Access to Sql server express
> 2005.
> I have problem with cdate() and with date() within the sql string.
>
> My question is : how to translate this query for use with sql server?
> sql = "SELECT count(*)" _
> & "FROM mytable " _
> & "where cdate(anyday)>= date() ;"
>
>
> Thanks
> Bart
>
>
>
>


Mubashir Khan

3/21/2007 5:11:00 PM

0

you can always use convert function to extract date and time parts from your
column of datetime type
"Bart" <baa@qsd.dfv> wrote in message
news:e3ohyh9aHHA.4140@TK2MSFTNGP06.phx.gbl...
> Hi,
>
> i'm conerting a asp.net application from Access to Sql server express
> 2005.
> I have problem with cdate() and with date() within the sql string.
>
> My question is : how to translate this query for use with sql server?
> sql = "SELECT count(*)" _
> & "FROM mytable " _
> & "where cdate(anyday)>= date() ;"
>
>
> Thanks
> Bart
>
>
>
>


Tibor Karaszi

3/21/2007 5:43:00 PM

0

Check out http://www.karaszi.com/SQLServer/info_datetime.asp... and you might want to read
the whole article.

--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/d...
http://sqlblog.com/blogs/tib...


"Bart" <baa@qsd.dfv> wrote in message news:e3ohyh9aHHA.4140@TK2MSFTNGP06.phx.gbl...
> Hi,
>
> i'm conerting a asp.net application from Access to Sql server express 2005.
> I have problem with cdate() and with date() within the sql string.
>
> My question is : how to translate this query for use with sql server?
> sql = "SELECT count(*)" _
> & "FROM mytable " _
> & "where cdate(anyday)>= date() ;"
>
>
> Thanks
> Bart
>
>
>
>

Bart

3/21/2007 7:23:00 PM

0

Thanks all

"Mubashir Khan" <mubi@yahoo.com> schreef in bericht
news:O4CK9v9aHHA.2448@TK2MSFTNGP02.phx.gbl...
> you can always use convert function to extract date and time parts from
> your column of datetime type
> "Bart" <baa@qsd.dfv> wrote in message
> news:e3ohyh9aHHA.4140@TK2MSFTNGP06.phx.gbl...
>> Hi,
>>
>> i'm conerting a asp.net application from Access to Sql server express
>> 2005.
>> I have problem with cdate() and with date() within the sql string.
>>
>> My question is : how to translate this query for use with sql server?
>> sql = "SELECT count(*)" _
>> & "FROM mytable " _
>> & "where cdate(anyday)>= date() ;"
>>
>>
>> Thanks
>> Bart
>>
>>
>>
>>
>
>


j.gemmell

3/6/2014 8:13:00 PM

0

On Thu, 6 Mar 2014 09:46:13 -0800 (PST), SAW <quarke.e2@gmail.com> wrote:

>On Thursday, March 6, 2014 12:44:03 PM UTC-5, JOSHUA wrote:
>> On Thu, 06 Mar 2014 11:37:08 -0600, JOSHUA <j.gemmell@ymail.com> wrote:
>>
>>
>>
>> [Correction]:
>
>Why do you have to keep making posts for?

The Goal Was To Get Redress Of The Wrongs Done By My Branch President.

You right. It was important to me to get redress for the injustice of
Branch President Paul Gossell, in trying to sell me the higher priesthood
for a calling well done for six months. And the lie that a vote new
candidates for the priesthood can be taken every six months during General
Church Conference. And President Paul Gossell lie that he would set up a
meeting with the Stake authority for me to tell them that Paul was trying
to sell me the priesthood for a calling well done, and he had lie to me in
the name of the Lord that a vote before the ward can only be taken every
six months. And Paul Gossell wanting to cover up his transgressions and
lies about his attitude about not caring about what the Lord said about
priest craft and unrighteous dominion over the souls of men by working
against the will of God. All I asked Gossell was that he pray to God and
let God tell him if I needed the higher priesthood. To which Paul Gossell
answer: "Oh I wish I had the time to go to the temple but I don't have the
time to go and pray to God for you." The people of God need someone who
has time for the works of the Lord, not someone who only accepts a church
position to see what benefits he can get from his church authority. Yes, I
have no doubt that "Gossell" means "Gospel for sell" and that is why I
post, hoping to draw attention to my posts, hoping that someone who has
authority to redress the wrongs done to me by Paul Gossell.

However, I have done everything I can, and now I must withdraw and leave it
in the hands of the Lord to redress. If the Lord doesn't care enough to
correct the evils of the Westbank First Branch President Paul Gossell in
Harvey, Louisiana - then there is no reason why I should continue to
posting, for I don't want to belong to a church that has no justice in its
church affairs. <X><

I needed to leave a record for Judgment Day, posting here is part of Book
of Remembrance, and it's a record that rise up on Judgment Day against the
LDS Church not standing up against the unrighteous dominion of President
Paul Gossell.

I think I have accomplished this, and your right I can't continue to this
bitterness against the evils done to me. I now leave it to God to redress.
<G>< <X><

j.gemmell

3/6/2014 8:19:00 PM

0

On Thu, 06 Mar 2014 14:12:59 -0600, JOSHUA <j.gemmell@ymail.com> wrote:

[Correction]:

>I think I have accomplished this, and your right I can't continue [with] this
>bitterness against the evils done to me. I now leave it to God to redress.
><G>< <X><

Mulligan

3/7/2014 3:30:00 PM

0

On Thursday, March 6, 2014 3:12:59 PM UTC-5, JOSHUA wrote:
> On Thu, 6 Mar 2014 09:46:13 -0800 (PST), SAW <quarke.e2@gmail.com> wrote:
>
>
>
> >On Thursday, March 6, 2014 12:44:03 PM UTC-5, JOSHUA wrote:
>
> >> On Thu, 06 Mar 2014 11:37:08 -0600, JOSHUA <j.gemmell@ymail.com> wrote:
>
> >>
>
> >>
>
> >>
>
> >> [Correction]:
>
> >
>
> >Why do you have to keep making posts for?
>
>
>
> The Goal Was To Get Redress Of The Wrongs Done By My Branch President.
>


How is posting here going to do anything of the kind?

j.gemmell

3/7/2014 5:47:00 PM

0

On Fri, 7 Mar 2014 07:30:04 -0800 (PST), SAW <t2judgment@gmail.com> wrote:

>On Thursday, March 6, 2014 3:12:59 PM UTC-5, JOSHUA wrote:
>> On Thu, 6 Mar 2014 09:46:13 -0800 (PST), SAW <quarke.e2@gmail.com> wrote:
>>
>>
>>
>> >On Thursday, March 6, 2014 12:44:03 PM UTC-5, JOSHUA wrote:
>>
>> >> On Thu, 06 Mar 2014 11:37:08 -0600, JOSHUA <j.gemmell@ymail.com> wrote:
>>
>> >>
>>
>> >>
>>
>> >>
>>
>> >> [Correction]:
>>
>> >
>>
>> >Why do you have to keep making posts for?
>>
>>
>>
>> The Goal Was To Get Redress Of The Wrongs Done By My Branch President.
>>
>
>
>How is posting here going to do anything of the kind?

Everything posted here gets recorded by angels, for it's my Book of
Remembrance. And if I don't care enough to write it down, neither will the
angels care enough to copy it for the Day of Judgment.

There are only two books used on the Day of Judgment.

The Book of Life which is connected to our DNA, which records everything.
And the Book of Remembrance, which I am supposed to write down and keep?

16 Then they that feared the Lord spake often one to another: and the Lord
hearkened, and heard it, and a book of remembrance was written before him
for them that feared the Lord, and that thought upon his name.
17 And they shall be mine, saith the Lord of hosts, in that day when I
make up my jewels; I will spare them, as a man spareth his own son that
serveth him.
18 Then shall ye return, and discern between the righteous and the wicked,
between him that serveth God and him that serveth him not. [Malachi
3:13-48]

Yes, I have kept my book of remembrance, and the Lord shall keep his
promise to spare me. And everything I write shall rise up to condemn the
wicked priesthood holders, for the priesthood was given to be used by the
Mormons who thought it was okay to turning a blind eye to the injustice
done to me. But they have mocked God by not using their priesthood.

Whenever you see wrong done in the name of God and you nothing to stand up
against it, you are then just as guilty as the one who does the wrong! <X><

j.gemmell

3/7/2014 5:51:00 PM

0

On Fri, 07 Mar 2014 11:47:03 -0600, JOSHUA <j.gemmell@ymail.com> wrote:

[Correction}:
>
>Whenever you see wrong done in the name of God and you [do] nothing to stand up
>against it, you are then just as guilty as the one who does the wrong! <X><