Link to home
Start Free TrialLog in
Avatar of dagga007
dagga007

asked on

Select all records for one day.

I looking to return only records you the current date with out any user input
Access has a DATE() function. Not sure what to use in SQL
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

sql server is getdate()

You can use  GETDATE () instead of DATE()
Avatar of dagga007
dagga007

ASKER

Should the getdate() return all records for todays date?
No, getdate stores the current date + current time


SELECT CONVERT(varchar(10),GETDATE(),101) -- mm/dd/yyyy
SELECT CONVERT(varchar(10),GETDATE(),103) -- dd/mm/yyyy
Not sure i follow, I think that i'm on the wrong track.

 I'm looking to return all record for one day with out any user input.
ASKER CERTIFIED SOLUTION
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Select * From YourTable Where Convert(Varchar, DateColumn, 101) = Convert(Varchar, GetDate(), 101)

Imran