Solved

Need Criteria For Day of week and time range in MS Access query

Posted on 2014-09-13
6
751 Views
Last Modified: 2014-09-13
I have a table of transactions which includes  a field for Date and another for time. I need to select all records for Saturday  later than 18:00.
0
Comment
Question by:PetGuy
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 49

Expert Comment

by:PortletPaul
ID: 40321250
all Saturdays,  just the "last Saturday", or something else?

& any chance of you telling us the table name and the field names?
0
 
LVL 27

Accepted Solution

by:
MacroShadow earned 500 total points
ID: 40321256
Select * FROM YourTable WHERE Weekday(DateField) = 7 AND TimeField > #18:00#
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 40321259
select *
from tablex
where weekday([datefield])=7 and [timefield]> timeserial(18,0,0)
0
Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

 

Author Comment

by:PetGuy
ID: 40321264
All Saturdays. I need to look at sales totals for that time period over the last couple of years. If I can get a query that selects just that period it is easy for me to write a report that will give me the numbers I need. Besides I might just learn something.

The table is [Product History]  Fields of relevance are [Product Code], [Description One], [Sales Value], [Transaction Date] and [Transaction Time].
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 40321282
try this query

select [Product Code], [Description One], [Sales Value], [Transaction Date], [Transaction Time]
From  [Product History]
Where Weekday([Transaction Date])= 7 And  [Transaction Time] > Timeserial(18,0,0)
0
 

Author Closing Comment

by:PetGuy
ID: 40321298
Thank you, Swift and exactly what I needed.
0

Featured Post

More Than Just A Video Library

Train for your certification. Learn the latest DevOps tools. Grow your skillset to do better work.

At Linux Academy, we release new training modules every week so you'll always be up to date on the latest tech.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

AutoNumbers should increment automatically, without duplicates.  But sometimes something goes wrong, and the next AutoNumber value is a duplicate.  This article shows how to recover from this problem.
Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

628 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question