Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Entering in one date, but including previous day from 18:00 1

Status
Not open for further replies.

Stevehewitt

IS-IT--Management
Jun 7, 2001
2,075
GB
Guys,

Sorry, this sounds like quite a complex problem, although I'm sure it's not!!!

We have a query that returns all records that are within a certian date range on the 'DateIn' field. The criteria is:

Between ([Forms]![frmReportDateSpecific]![txtStartDate]) And ([Forms]![frmReportDateSpecific]![txtEndDate])

All is well and good. However I need to change it slightly so that it lists all records that are between the two date ranges, but also includes all records that have a 'TimeIn' of the previous day to the start date between #18:00# and #00:00#.

E.G. Between 20/07/2005 and 21/07/2005 AND 19/07/2005 where DateIn = >#17:59# and #00:00#

As the date is a parameter, I can't hard code it into the VBA code of the report or anything.

Just to summarise:

I have a parameter query which asks for two dates and queries the database between those two dates. I need it to continue to do this, but also select / show all records that have a 'TimeIn' value of 17:59 or greater for the day before the first date entered.

HELP!!! :)

Any help appreciated!

Cheers,



Steve.

"They have the internet on computers now!" - Homer Simpson
 
all you would need to do in your query, in the next line down in the query builder put

[Forms]![frmReportDateSpecific]![txtStartDate]-1 in the DateIn field and >#17:59# in the TimeIn field or something like that.

This will still bring in the original query, but also show you the stuff from the day before the start date, but only stuff put in 18:00 onwards (there no need to do a between on this one)

I hope this helps.

Any issues let me know.
 
Cheers, thanks for that - works brilliantly. One of those where you think it's a lot harder than it really is - so you keep on thinking of the more complex ways to get a round it!!!

Duh! (Time for a coffee)

Thanks,



Steve.

"They have the internet on computers now!" - Homer Simpson
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top