Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2014-09-13
6
Medium Priority
?
795 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 2000 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
Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

 

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

Survive A High-Traffic Event with Percona

Your application or website rely on your database to deliver information about products and services to your customers. You can’t afford to have your database lose performance, lose availability or become unresponsive – even for just a few minutes.

Question has a verified solution.

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

This post looks at MongoDB and MySQL, and covers high-level MongoDB strengths, weaknesses, features, and uses from the perspective of an SQL user.
Traditionally, the method to display pictures in Access forms and reports is to first download them from URLs to a folder, record the path in a table and then let the form or report pull the pictures from that folder. But why not let Windows retr…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

704 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