There is also a LAST_DAY() function that returns the last day of the month:
http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functions.html
Peter Brawley wrote:
> # of days since the first of the month from last month
datediff(now(),date(concat(period_add(date_format(now(),'%Y%m'),-1),'01'
> # of days since the first of the month from last month
datediff(now(),date(concat(period_add(date_format(now(),'%Y%m'),-1),'01')))
> the # of days since the end of last month (e.g. from 5/31/07)
datediff(now(),date_sub(concat(date_format(now(),'%Y-%m-'),'01'),INTERVAL
1 DAY))
PB
-
Andr
Can someone advise the best way to determine
a) the # of days since the first of the month from last month (e.g. from
5/1/07)
b) the # of days since the end of last month (e.g. from 5/31/07)
Is there are a good way to determine the # of workdays in a month.
Thanks,
Andrey
--
MySQL General Mai
;s how it's listed in the manual.
>
> date_add([thedatefield],Interval 15 day)
>
> Mark
>
> -Original Message-
> From: Serge Paquin [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, March 26, 2003 10:35 AM
> To: [EMAIL PROTECTED]
> Subject: Re: DATE function questio
5 AM
To: [EMAIL PROTECTED]
Subject: Re: DATE function question
I believe the following will work:
date_add([thedatefield],Interval 15 days)
I am almost sure I got the syntax right off the top of my head. Check
mysql.com for "date functions" if the above doesn't work.
Serge.
On
MAIL PROTECTED]> wrote:
> I have a small question about the DATE function. This is what I want to do:
>
> - User enters information into form and submits it to database
> - When info is added to database the current date is stored ala 2003-03-26
> - Now I want to take that date 20
I have a small question about the DATE function. This is what I want to do:
- User enters information into form and submits it to database
- When info is added to database the current date is stored ala 2003-03-26
- Now I want to take that date 2003-03-26 and tack on either 15 or 30 days
on to it
Could you pls send me answer of my question
1.How to convert this "10-Sep-2003" in a -MM-DD sql format effeciently.Like it
should be 2003-09-10.
Thanks,
Abhi
-
Before posting, please check:
http://www.mysql.co
This should work :
$SQL = "INSERT INTO orders (Customer_Id, Order_Date)".
"VALUES($CustID,Now())";
Xavier
-Message d'origine-
De : Alia Mikati [mailto:[EMAIL PROTECTED]]
Envoyé : vendredi 19 avril 2002 11:28
À : [EMAIL PROTECTED]
Objet
I never saw the function "date()", to insert current date use:
CURRENT_DATE();
regards,
Jan
- Original Message -
From: "Alia Mikati" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, April 19, 2002 11:27 AM
Subject: Date function
> Hel
Hello
I have the following SQL and I wanna insert the current date in one of
the table fields but it's not working. Can u tell me whats the problem?
(I'm using mysql and php)
Thx a lot
$SQL = "INSERT INTO orders (Customer_Id, Order_Date)".
"VALUES($CustID,date())";
-
mysql> select name from tableName
-> where month(birthDate) = 7;
-Original Message-
From: Sharif Islam [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 19, 2001 8:56 AM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Date function.
This is a simple mysql question i am having problm
12 matches
Mail list logo