Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 824
  • Last Modified:

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

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
PetGuy
Asked:
PetGuy
1 Solution
 
PortletPaulCommented:
all Saturdays,  just the "last Saturday", or something else?

& any chance of you telling us the table name and the field names?
0
 
MacroShadowCommented:
Select * FROM YourTable WHERE Weekday(DateField) = 7 AND TimeField > #18:00#
0
 
Rey Obrero (Capricorn1)Commented:
select *
from tablex
where weekday([datefield])=7 and [timefield]> timeserial(18,0,0)
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
PetGuyAuthor Commented:
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
 
Rey Obrero (Capricorn1)Commented:
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
 
PetGuyAuthor Commented:
Thank you, Swift and exactly what I needed.
0

Featured Post

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.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now