Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How Do I get record set for before certain date

Status
Not open for further replies.

choohean

Technical User
Jan 15, 2002
57
0
0
MY
I have created a database that store certain value and date as well at the same time! How do I get record set which is before certain date?

Please give me a hand!

Thanks for your kindness!!
 
Usually, you have to Convert() the date to strip off the time. For example, convert(varchar(20),MyDate(),112) gives you yyyymmdd. So could do something like this:

Select * from MyTable Where
convert(varchar(8),MyDate1(),112) <
convert(varchar(8),MyDate2(),112)



This guy has a good date/time page. Check it out.

Terry
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top