Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.
-
YogeshM #1
Get last day of month
Hi,
Is there a way to get the last day of each month using CFMX7 pls?
E.g. I want to obtain the last day of each month, 30th June 2005 (30/06/2005),
31st July 2005 (31/07/2005) and so on. Is there a way to do that in CFMX7 pls?
Thanks and regards,
Yogesh Mahadnac
YogeshM Guest
-
Getting the day of the month
I think it is kind of odd that the "day" property in the Date class will only return the day of the week and not the day of the month... How would... -
to convert a month to previous month
How to convert a month to previous month in a very easy way? For example, I have AUGUST, but I want JULY to return. Thanks. *** Sent via... -
LAST DAY OF MONTH
How can I get the last day for the current month? -
[PHP] LAST DAY OF MONTH
wow. I missed that one in the manual. I guess it's time for me to call it a night. Thanks. -----Original Message----- From: Sn!per Sent:... -
Month(x) vs Between(x and y)
With few exceptions, if a column is in an expression in a search condition, no index on that column will be useable by the query processor. In... -
maquejp #2
Re: Get last day of month
Hello,
You should go and take a look on:
[url]http://www.cflib.org/udf.cfm?id=639[/url]
I think that it is what you want to...
I fact it is quite easy to do as you now pretty well for all the month over
the year the only aspect to keep in mind is about february and leap years.
maquejp Guest
-
dempster #3
Re: Get last day of month
There's a ColdFusion function called DaysInMonth() that will give you this. The
parameter is a date object, so given a date such as July 1, 2005 the function
would return 31 and you can create another date object for the last day in
month.
-Paul
dempster Guest
-
christopher.secord@gmail.com #4
Re: Get last day of month
A couple of other people have already answered, but I'll throw in my
two cents and offer one more possible solution:
dateAdd("d",-1,dateAdd("m",1,"1/06/2005"))
The above example assumes European date formatting. It starts with
June 1st (your sample data) and adds one to the month, resulting in
July 1st. Then it subtracts one day, resulting in June 30th.
christopher.secord@gmail.com Guest
-
YogeshM #5
Re: Get last day of month
Hi,
That was not quite what I wanted.
I've got a list of dates in my database (10th september 2004 up to now).
Records are inserted on a daily basis. I needed to to do a query to get the
last day of each month i.e. 30/09/2004, 31/10/2004, etc up to 30/06/2005 to do
some additional calculations.
Any suggestions?
Yogesh Mahadnac
YogeshM Guest
-
BKBK #6
Re: Get last day of month
Try something like
<cfset yr=Year(dateFromQuery)>
<cfset m=Month(dateFromQuery)>
<cfset d=DaysInMonth(dateFromQuery)>
<cfset lastDayOfMonth=Createdate(#yr#,#m#,#d#)>
BKBK Guest
-
YogeshM #7
Re: Get last day of month
Thanks!
It really helped.
Cheers...
Yogesh Mahadnac
YogeshM Guest



Reply With Quote

