If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > calander months (date query)

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 05-05-04, 00:44
noamkrief noamkrief is offline
Registered User
 
Join Date: Dec 2003
Posts: 61
calander months (date query)

i run a logbook for pilots.
I'm trying to have a query that can come up with a date that is in the preceding 3 calander months.

Right now i have:

SELECT Sum(MAIN.DAY_LAND+MAIN.NIGHT_LAND) AS TOTALLAND FROM MAIN WHERE PER_ID='$username' AND MAIN.DATE >= date_sub(current_date, interval 3 month)

but this won't work for me. It needs to round up automatically.

so if the current date is 5/20/2004 it needs to check on dates from 1/31/2004

Is this possible?

thanks
Noam
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On