Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Query Not Working

Status
Not open for further replies.

whjwilson

Technical User
Jan 20, 2006
23
0
0
US
I am running a query on one of my tables in my database but it is not pulling the information I am asking it too. Here is what I have so far.

Pass Issued by Date Issued
Jones Friday, March 10,2006
Franks Thursday, March 9, 2006


The date is formated to give me the Long date. I want to run a query to see for instance only passes issued on a Friday day. I have this for my SQL:

SELECT *
FROM Main
WHERE (((Main.Date_Issued) Like '*Friday*'));

Main is the title of my main table.

The query will not run as I thought it would and give me all the Fridays in the database. Any suggestions?
 
Presumably the database field "Date_Issued" is a DateTime field. If so, it doesn't actually contain the word "Friday" (its a number). You probably need something like
Code:
SELECT *
FROM Main
WHERE WeekDay(Main.Date_Issued) = 6
Days are numbered as 1=Sunday, 2=Monday, etc.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top