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

Using convert and getdate functions

Status
Not open for further replies.

RevelationUK

Technical User
Jun 29, 2005
6
GB
Im trying to make a query , heres what I have so far: (the Date in my access database is in the format "dd/mm/yyyy")

SELECT *
FROM tblCustomers
WHERE (tblCustomers.State='No Letters Sent')
And (tblCustomers.DateEntered='29/06/2005');

however I get type mis match, now I believe I have to use the convert function maybe to change the date type? Secondly, I want to return the records where tblCustomers.DateEntered = TodaysDate. How do I do that?

SELECT *
FROM tblCustomers
WHERE (tblCustomers.DateEntered = Convert(something,getdate(),103)


maybe? Im guessing? thanks in advance, rev.
 
You may try simply this:
tblCustomers.DateEntered = Date

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Access queries use U.S. formatted dates
SELECT *
FROM tblCustomers
WHERE (tblCustomers.State='No Letters Sent')
And (tblCustomers.DateEntered=#06/29/2005#);

To refer to today, use Date(). When using Date() in a module, the ()s are removed.


Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top