Date formulas?

N

Neal

I am useing this formula in one of my queries:
On the criteria line of that date field write:

Between [Start Date] and [End Date]

I am trying to find out if there is some sort of shortcut to allow all
records to be shown. Almost a bypass shortcut.

I have also tried this formula
=[Start Date] and <=[End Date]

it worked as a bypass however it did not show any entries.




Thanks...
 
J

John Vinson

I am useing this formula in one of my queries:
On the criteria line of that date field write:

Between [Start Date] and [End Date]

I am trying to find out if there is some sort of shortcut to allow all
records to be shown. Almost a bypass shortcut.

I have also tried this formula
=[Start Date] and <=[End Date]

Try


WHERE ([datefield] >= [Start Date] OR [Start Date] IS NULL)
AND ([datefield] <= [End Date] OR [End Date] IS NULL)

If the user enters only a start date the query will show all dates
later than that date; only an end date will show all earlier; neither
date will show all records.

John W. Vinson[MVP]
Join the online Access Chats
Tuesday 11am EDT - Thursday 3:30pm EDT
http://community.compuserve.com/msdevapps
 
N

Neal

I keep getting an error: Undefined function "WHERE" in expression

John Vinson said:
I am useing this formula in one of my queries:
On the criteria line of that date field write:

Between [Start Date] and [End Date]

I am trying to find out if there is some sort of shortcut to allow all
records to be shown. Almost a bypass shortcut.

I have also tried this formula
=[Start Date] and <=[End Date]

Try


WHERE ([datefield] >= [Start Date] OR [Start Date] IS NULL)
AND ([datefield] <= [End Date] OR [End Date] IS NULL)

If the user enters only a start date the query will show all dates
later than that date; only an end date will show all earlier; neither
date will show all records.

John W. Vinson[MVP]
Join the online Access Chats
Tuesday 11am EDT - Thursday 3:30pm EDT
http://community.compuserve.com/msdevapps
 
J

John Vinson

I keep getting an error: Undefined function "WHERE" in expression

Sorry, I was using shorthand! The WHERE clause would be part of the
SQL expression. Try leaving the word WHERE out and just put the entire
expression in a Criteria cell. If that doesn't work, please post the
SQL view of your query.

John W. Vinson[MVP]
Join the online Access Chats
Tuesday 11am EDT - Thursday 3:30pm EDT
http://community.compuserve.com/msdevapps
 
Top