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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

All Days in current Week Query

Status
Not open for further replies.

oggl

Vendor
Apr 25, 2005
1
DE
Hi there,

greetings from Germany. May you can help me. I need help to set up an SQL Query with the following conditions.

I need all Entrys created in This Week.

The Week starts with monday till friday.

Can you give me an SQL Query command ?

(SELECT * FROM MAIN WHERE DATE = {THIS WEEK}}

Thx for help

Brain
 
How about:
[tt]
SELECT *
FROM main
WHERE
`date`
>=CURDATE()-INTERVAL WEEKDAY(CURDATE()) DAY
[/tt]
This returns all records with a `date` value of Monday or later. By the way, `date` is an SQL reserved word. You should change the field name to something non-reserved if possible.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top