Solved

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

Posted on 2014-09-13
6
732 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 48

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
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
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 …

739 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