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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

datetime probs 1

Status
Not open for further replies.

esdee

Programmer
Apr 12, 2001
143
US
hi, i gotta write a query in access that limits the records to a period between to dates. how can i do this ?
im writing the application in c# and passing two strings from DateTime, but cant convert to Access Date/Time. neither cast nor convert seem to work.
i need

select * from stats
where timeStarted between cast('2/21/2005' as datetime) and cast('2/30/2005' as datetime)


thanx !
 
CAST and CONVERT are SQL Server functions

yes, i know it's tempting to assume that the sql used in one microsoft product would work in another microsoft product, but that ain't how it is in real life
Code:
select * from stats
 where timeStarted 
       between #2005-02-21# 
           and #2005-02-30#
:)


rudy | r937.com | Ask the Expert | Premium SQL Articles
SQL for Database-Driven Web Sites (next course starts May 8 2005)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top