Solved

Find all rows based on day of week

Posted on 2011-03-23
5
669 Views
Last Modified: 2012-05-11
I am importing an appointment schedule from an old software into a new one.  I have a situation where I need to seperate out some appointments.  Is there any way I can query the appointments table and say something like this:

SELECT * FROM Appointments WHERE DATE is a Tuesday?

This way I'll get all appointments that were scheduled on a Tuesday.  And I'll need to do the same for other weekdays as well.

NOTE:  I can pull this table into SQL Server 2008 if that makes querying easier.
NOTE:  All dates are in the year 2011.

JamesNT
0
Comment
Question by:JamesNT
[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
5 Comments
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 35198163
in access, you can use

format(Date(),"dddd")="Thursday"

or

weekday(Date())=5

0
 
LVL 3

Expert Comment

by:Thomas_Roes
ID: 35198204
There is a function: (my date-field is called 'dag')

Weekday([dag])

You can filter on this.

Thomas Roes
0
 
LVL 18

Accepted Solution

by:
p912s earned 500 total points
ID: 35198253
Your complete SQL string would be like this.

SELECT * FROM Appointments WHERE ((Weekday([YOURDATEFIELDHERE])="3"));

0
 
LVL 44

Expert Comment

by:GRayL
ID: 35199944
3 above should not be in quotes
0
 
LVL 18

Expert Comment

by:p912s
ID: 35202332
Thanks for the grade and points!
0

Featured Post

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

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

Suggested Solutions

Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
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…

734 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