Select Qry Range

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi: I have a table in an access database and would like to write a select qry
on one field that currently has a date in a format like, 2006-05-12-15.47.50.
Is it possible to have a qry that will pull a range (From and To) within
that one field, by only specfiying the 2006-05-12-**.**.**? Thanks.
 
You would use Between Like "2006-05-12-*" And Like 2006-05-12-*"

But you will be better off in the long run the revise your database and use
a datatype DateTime instead of a text field.
 
Not fast but use a calculated field to get a real date and then use a date
range on that


Field: JustTheDate: DateValue(Left(YourDateField,10))
Criteria: Between #2006-05-01# and #2006-05-30#

To be really safe, you might test the field value first to make sure it will
return a date

IIF(IsDate(Left(YourDateField,10)),DateValue(Left(YourDateField,10)),Null)

Or you could try
 
Back
Top