Re: Last Date of previous month
Posted in 2003
Topics: SQL Development & Query Writing
get current year and month set day element of that to 1 (i.e. the first) subtract 1 day from that viola - the last day of last month. The major flaw in this approach is that you are limited to running for ONLY last month, if you wish to run a report for two months ago your code won't handle it. It's never a good idea to put date specification logic like this into the query - always better to pass it in as a parameter - which you can do with ace. I would move the date logic out to the OS and not make ace worry about it. cheers j. -.-- --- ..- / -. . . -.. / - --- / --. . - / .- / .-.. .. ..-. . .-.-.- / ... --- / -.. --- / .. .-.-.- ----- Original Message ----- From: "navdeep virk" <nvirk@msn.com> To: <rkusenet@sympatico.ca>; <informix-list@iiug.org> Sent: Monday, November 10, 2003 10:31 AM Subject: Last Date of previous month > List , > > I want to obtain the Last Date of previous Month ie 09/30/2003 ,if report is > run in Oct . and 10/31/2003 when report is run in Nov. I need a Sql > solution as I will be using an ACE report . > > --Message for rkusenet -Ravi , you email Id please ,send it to this address > . > > TIA > > Navdeep > > _________________________________________________________________ > Concerned that messages may bounce because your Hotmail account is over > limit? Get Hotmail Extra Storage! http://join.msn.com/?PAGE=features/es > > sending to informix-list > sending to informix-list
"Jack Parker" <vze2qjg5@verizon.net> wrote in message news:boonur$etf$1@terabinaries.xmission.com... > > > get current year and month > set day element of that to 1 (i.e. the first) > subtract 1 day from that > viola - the last day of last month. Viola? Is that viola da spalla or viola da gamba? Or perhaps even voil'?!