Solved: Defining time and date queries in Access 2003

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

cathing59

Thread Starter
Joined
Nov 30, 2011
Messages
6
Hi,
I run a 24hour business and need to follow monthly trends in product
sales. I would like to differentiate sales during regular hours (Mon-Fri, 8am -5pm) from non regular hours. How do I put that criteria in a query? I can do it for one day, but not those hours over an extended period. I am not techno savvy. Thank you.
 

OBP

Joined
Mar 8, 2005
Messages
19,895
cathing59, welcome to the Forum.
Can you provide an example of the data and how you would like it?
I would think a crosstab query would be what you need.
 

cathing59

Thread Starter
Joined
Nov 30, 2011
Messages
6
I want to track products, invoices and customers from tables I have. If I put all these tables into my query, but only want to display the invoices that were generated between 8am and 5 pm, Monday to Friday, I don't know how to set that up under the criteria.
 

OBP

Joined
Mar 8, 2005
Messages
19,895
You will need to split the Time out from the Date, have you already done that?
You then need to convert the date to the day of the week, by adding a column like this

dayofweek: Format([DATEADDED],"dddd")

But use your date field name instead of DATEADDED
and in it's Criteria enter

Between "Monday" And "Friday"
 

OBP

Joined
Mar 8, 2005
Messages
19,895
You can do it in a similar way to the days that I split out using
Using something like this
Time: Format([DATEADDED],"hh:mm")
but using your Date/time field.
 

cathing59

Thread Starter
Joined
Nov 30, 2011
Messages
6
Sorry. This invoice table is populated in the date dd/mm/yyyy hh:mm:ss format. It is labelled Invoicedate. Am I changing it under the table, or under the query? Is this done under the Expression builder???
 

OBP

Joined
Mar 8, 2005
Messages
19,895
This is done in a query and you don't need an expression builder.
They are new Column headings.
You just need to reproduce what I posted using your date field name instead of DATEADDED which is the name of the field in the database query that I tested it on.
The Criteria can go in exactly as I posted in to your new dayofweek column.
If you want to attach a zipped database with just your table with the date field in it I can do it for you. But I will have to go very soon.
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Members online

Top