Question
Todays date in MS SQL
Hi, I know this is kinda a noob questions but i just cant
figure it out.
I have a query that wants to pull all of todays data. No matter wht i use i cant seem to pull it out of the db.
I have MS SQL 2000 and CF 7.
My Where statement is as follows:
where paymentdate = #CreateODBCDate(now())#
I have also tried just now() and i have even tried this:
<cfset dttoday = CreateDate(
Year( dtNow ),
Month( dtNow ),
Day( dtNow )
) />
Then: where paymentdate = #CreateODBCDate(dttoday)#
No matter what i do i cant get anything to pull TODAYS info out of the DB.
FYI, in another query i can pull all of the data for the past 7 days like this:
where paymentdate Between #CreateODBCDate(DateAdd("d", -6, Now()))# AND #CreateODBCDate( dateadd("d",1,now()))#
And that works just fine. it even pulls todays data out correctly.
I just want only TODAYS data.
Any help would be appreciated.
Thanks
I have a query that wants to pull all of todays data. No matter wht i use i cant seem to pull it out of the db.
I have MS SQL 2000 and CF 7.
My Where statement is as follows:
where paymentdate = #CreateODBCDate(now())#
I have also tried just now() and i have even tried this:
<cfset dttoday = CreateDate(
Year( dtNow ),
Month( dtNow ),
Day( dtNow )
) />
Then: where paymentdate = #CreateODBCDate(dttoday)#
No matter what i do i cant get anything to pull TODAYS info out of the DB.
FYI, in another query i can pull all of the data for the past 7 days like this:
where paymentdate Between #CreateODBCDate(DateAdd("d", -6, Now()))# AND #CreateODBCDate( dateadd("d",1,now()))#
And that works just fine. it even pulls todays data out correctly.
I just want only TODAYS data.
Any help would be appreciated.
Thanks
