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

How to sort user's info by date of arrival?

Status
Not open for further replies.

roman78

Technical User
Jun 28, 2004
7
MX
Hello everybody!,

As a mysql newbie, I'm having a problem because of my lack of knowledge of sql.

Let's me explain; I have an email form which sends the user's info directly to a table that storage the name, email, subject, message, and the time it arrived. I need to create a form report which let me know mails that arrived either today, yesterday, or even one week ago.

I would like to know how to query the database to display the user info by date of arrival and display the result into a table.


I hope someone could help me!
Thanks you so much.
 
Code:
select name
     , email
     , subject
     , message
     , arrival
  from daTable
 where arrival >=
       date_sub(current_date, interval 1 day)
order
    by arrival
gives you all messages for yesterday and today

r937.com | rudy.ca
 
thank you so much!
Have a great day!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top