Time Query

  • Thread starter jstampacchia via AccessMonster.com
  • Start date
J

jstampacchia via AccessMonster.com

How would I exclude the Mar 21 AM entries from my multi date query? Becasue
it's multi date I cannot get the Time <#04:00# to work (filters all entries).
Help??

Thanks, Julius


Date Time Prod Order #
21-Mar-07 12:25:02 AM 143118 X
21-Mar-07 12:25:02 AM 143118 X
21-Mar-07 2:34:20 AM 143119 X
21-Mar-07 3:48:25 AM 143120 X
21-Mar-07 3:48:25 AM 143120 X
21-Mar-07 3:48:25 AM 143120 X
21-Mar-07 4:33:15 PM 143220
21-Mar-07 4:33:15 PM 143220
21-Mar-07 4:33:15 PM 143220
21-Mar-07 4:47:40 PM 143220
21-Mar-07 4:47:40 PM 143220
21-Mar-07 4:47:40 PM 143220
21-Mar-07 7:15:13 PM 143207
21-Mar-07 7:15:13 PM 143207
21-Mar-07 9:39:09 PM 143221
21-Mar-07 9:39:09 PM 143221
21-Mar-07 10:01:20 PM 143222
21-Mar-07 11:36:30 PM 143223
21-Mar-07 11:36:30 PM 143223
22-Mar-07 2:38:07 AM 143213
22-Mar-07 2:38:07 AM 143213
22-Mar-07 3:19:07 AM 143226
22-Mar-07 3:19:07 AM 143226
22-Mar-07 3:45:00 AM 143227
22-Mar-07 3:45:00 AM 143227
 
G

Guest

I assume each line is a record? (sorry if that's daft question).

Try the following in the query

hour: (Format([time],"hh"))

criteria: <13
 
J

jstampacchia via AccessMonster.com

My "Time" column is combination of two tables.

I get an error because I did not define which table.

How do you reference both?
I assume each line is a record? (sorry if that's daft question).

Try the following in the query

hour: (Format([time],"hh"))

criteria: <13
How would I exclude the Mar 21 AM entries from my multi date query? Becasue
it's multi date I cannot get the Time <#04:00# to work (filters all entries).
[quoted text clipped - 28 lines]
22-Mar-07 3:45:00 AM 143227
22-Mar-07 3:45:00 AM 143227
 
J

John W. Vinson

How would I exclude the Mar 21 AM entries from my multi date query? Becasue
it's multi date I cannot get the Time <#04:00# to work (filters all entries).
Help??

SELECT * FROM yourtable
WHERE [Date] <> #3/21#
OR [Time] >= #04:00# (or #12:00# if you really mean to exclude AM entries)

Note that Date and Time are both reserved words and should NOT be used as
fieldnames.

John W. Vinson [MVP]
 
J

jstampacchia via AccessMonster.com

Unfortunately I am using linked tables to another software package. I cannot
change the column desciriptions for Date and Time.

I tried the following but get a syntax error. ?

SELECT * FROM [Length ---- LHomme] AND [Scrap ---- LHomme] WHERE [Date] <>
#3/21# OR [Time] >= #04:00#
How would I exclude the Mar 21 AM entries from my multi date query? Becasue
it's multi date I cannot get the Time <#04:00# to work (filters all entries).
Help??

SELECT * FROM yourtable
WHERE [Date] <> #3/21#
OR [Time] >= #04:00# (or #12:00# if you really mean to exclude AM entries)

Note that Date and Time are both reserved words and should NOT be used as
fieldnames.

John W. Vinson [MVP]
 
J

John W. Vinson

Unfortunately I am using linked tables to another software package. I cannot
change the column desciriptions for Date and Time.

I tried the following but get a syntax error. ?

SELECT * FROM [Length ---- LHomme] AND [Scrap ---- LHomme] WHERE [Date] <>
#3/21# OR [Time] >= #04:00#

You cannot use AND to join two tables: you would use a Join clause if records
in [Length ---- LHomme] are related (by some field you haven't posted) to
corresponding records in [Scrap ---- LHomme]; or a UNION query if you want to
look at all the records in Length and (as separate records) all the records in
Scrap. What in fact are these tables? Are they related, or do they just
contain independent records?

John W. Vinson [MVP]
 
J

jstampacchia via AccessMonster.com

John,

The tables are Quality Inspection records for two variables related by Work
Order #.
I wish to see all records from both tables between two dates and times.

I will try the "Union" suggestion.

Thanks,

Julius
Unfortunately I am using linked tables to another software package. I cannot
change the column desciriptions for Date and Time.
[quoted text clipped - 3 lines]
SELECT * FROM [Length ---- LHomme] AND [Scrap ---- LHomme] WHERE [Date] <>
#3/21# OR [Time] >= #04:00#

You cannot use AND to join two tables: you would use a Join clause if records
in [Length ---- LHomme] are related (by some field you haven't posted) to
corresponding records in [Scrap ---- LHomme]; or a UNION query if you want to
look at all the records in Length and (as separate records) all the records in
Scrap. What in fact are these tables? Are they related, or do they just
contain independent records?

John W. Vinson [MVP]
 
J

John W. Vinson

John,

The tables are Quality Inspection records for two variables related by Work
Order #.
I wish to see all records from both tables between two dates and times.

I will try the "Union" suggestion.

That's the right way to go, then.

It's not at all clear to me what your date/time criterion should actually be.
It's often easier to have the date and time stored in the same field.

John W. Vinson [MVP]
 

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

Top