Dates!

  • Thread starter Thread starter mfrisbyuk via AccessMonster.com
  • Start date Start date
M

mfrisbyuk via AccessMonster.com

Hi All

Im trying to setup a querry where i can select one day two days or a week
etc using a date picker?

the problem is when i use Between [Forms]![Report]![startdate] And [Forms]!
[Report]![enddate] in date column in the criteria it does not like the one
date selection.

Any ideas would be a great help, Thanks

Mark
 
mfrisbyuk said:
Hi All

Im trying to setup a querry where i can select one day two days or a
week etc using a date picker?

the problem is when i use Between [Forms]![Report]![startdate] And
[Forms]! [Report]![enddate] in date column in the criteria it does
not like the one date selection.

Any ideas would be a great help, Thanks

Mark

Which one? If your table data also contains non-midnight time values then you
have to add one day to the end date.
 
Rick said:
[quoted text clipped - 8 lines]

Which one? If your table data also contains non-midnight time values then you
have to add one day to the end date.
Hi Rick

Thanks for your reply, the latest that someone will use the db is 23:00 is
there away to set this so that i can choice one day, or is this a Access
thing that you have to choice the day to get it to work?

mark
 
Rick said:
[quoted text clipped - 8 lines]

Which one? If your table data also contains non-midnight time values then you
have to add one day to the end date.
Hi Rick

Thanks for your reply, the latest that someone will use the db is 23:00 is
there away to set this so that i can choice one day, or is this a Access
thing that you have to choice the day to get it to work?

mark

Think about it. 5/25/2006 midnight is not the same as 5/25/2006 23:00
PM.
So if you wish records for just 5/25/2006 you must actually search for
records up to midnight of the next day.

If your date includes a time value, then for ALL of your date
selections you will need to add 1 day to the End date.

Between [Start Date] and DateAdd("d",1,[End Date])

For just the one date, enter the same date twice when prompted.

Note, You could also use:
Between [Start Date] And (IIf(IsNull([End Date]),DateAdd("d",1,[Start
Date]),DateAdd("d",1,[End Date])))

In which case if only the Start Date is entered, the query will return
just that days records.
 
Hi Fred

Thank you for just want i wanted

Mark
[quoted text clipped - 12 lines]

Think about it. 5/25/2006 midnight is not the same as 5/25/2006 23:00
PM.
So if you wish records for just 5/25/2006 you must actually search for
records up to midnight of the next day.

If your date includes a time value, then for ALL of your date
selections you will need to add 1 day to the End date.

Between [Start Date] and DateAdd("d",1,[End Date])

For just the one date, enter the same date twice when prompted.

Note, You could also use:
Between [Start Date] And (IIf(IsNull([End Date]),DateAdd("d",1,[Start
Date]),DateAdd("d",1,[End Date])))

In which case if only the Start Date is entered, the query will return
just that days records.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top