I want to find records matching with given date and time

I used following codes but no records to match

Select * FROM sale  where billdate>=#" & Format(fromtime.Value, "dd/MMM/yyyy hh:mm:ss tt") & "# and endtime<=#" & Format(totime.Value, "dd/MMM/yyyy hh:mm:ss tt") & "#"
Ravindra IngleAsked:
Who is Participating?
Éric MoreauSenior .Net ConsultantCommented:
Are you using an Access database? can you try a simpler date format like this one:

Select * FROM sale  where billdate>=#" & fromtime.Value.ToString("yyyy/MM/dd") & "# and endtime<=#" & totime.Value.ToString("yyyy/MM/dd")  & "#"

Open in new window

Éric MoreauSenior .Net ConsultantCommented:
never got back, surely good!
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.