List:General Discussion« Previous MessageNext Message »
From:Peter Brawley Date:June 12 2007 8:13pm
Subject:Re: date function question
View as plain text  
 > # 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

-----

Andrey Dmitriev wrote:
> 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
>
>
>   
Thread
date function questionAndrey Dmitriev12 Jun
  • Re: date function questionPeter Brawley12 Jun
    • Re: date function questionBaron Schwartz12 Jun