Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 >= todays date

Author  Topic 

tinamiller1
Yak Posting Veteran

78 Posts

Posted - 2012-03-06 : 15:15:36
how in my where code do i make a date column >= to todays date.

where
proc_cd in ('28471', '90004')
and
market_row_end_dt >= todaysdate;

tina m miller

X002548
Not Just a Number

15586 Posts

Posted - 2012-03-06 : 15:17:13
What the datatype of market_row_end_dt

And you would use GetDate()



Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx


Want to help yourself?

http://msdn.microsoft.com/en-us/library/ms130214.aspx

http://weblogs.sqlteam.com/brettk/

http://brettkaiser.blogspot.com/


Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2012-03-06 : 15:17:34
market_row_end_date >= DATEADD(d, DATEDIFF(d, 0, GetDate()), 0)

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2012-03-06 : 15:31:09
How about

market_row_end_date >= CONVERT(date,GetDate())

Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx


Want to help yourself?

http://msdn.microsoft.com/en-us/library/ms130214.aspx

http://weblogs.sqlteam.com/brettk/

http://brettkaiser.blogspot.com/


Go to Top of Page

tinamiller1
Yak Posting Veteran

78 Posts

Posted - 2012-03-06 : 16:01:08
It is a datetime field


tina m miller
Go to Top of Page

tinamiller1
Yak Posting Veteran

78 Posts

Posted - 2012-03-06 : 16:04:09
Hum. None of those work. could it be because I am using SQL but connecting thru ODBC to a DB2 server?

tina m miller
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2012-03-06 : 16:04:36
Well I think Tara's or my format should float your boat

Well OK then...little important details

Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx


Want to help yourself?

http://msdn.microsoft.com/en-us/library/ms130214.aspx

http://weblogs.sqlteam.com/brettk/

http://brettkaiser.blogspot.com/


Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2012-03-06 : 16:07:08
quote:
Originally posted by tinamiller1

Hum. None of those work. could it be because I am using SQL but connecting thru ODBC to a DB2 server?

tina m miller



Yes of course that matters!

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2012-03-06 : 16:07:16
Besides the fact that there is no datetime in DB2

It's DATE, TIME or TIMESTAMP

So...what really is the data type in DB2

in ANY case..they all should still work

Is there any data in the table?

Why don't you post the entire query



Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx


Want to help yourself?

http://msdn.microsoft.com/en-us/library/ms130214.aspx

http://weblogs.sqlteam.com/brettk/

http://brettkaiser.blogspot.com/


Go to Top of Page
   

- Advertisement -