Get the start date of the month



IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

Get the start date of the month

Postby jvinoth » Tue Apr 24, 2012 12:47 pm

How to get the month's start date by giving the current date..please tell me how to get this using the sort..

suppose if we give the particular date we need to get the that date's month starting date...
thank you so much.
jvinoth
 
Posts: 132
Joined: Fri Nov 18, 2011 3:13 pm
Has thanked: 0 time
Been thanked: 1 time

Re: Get the start date of the month

 

Re: Get the start date of the month

Postby prino » Tue Apr 24, 2012 1:16 pm

Every month starts on the first, what's your problem?
Robert AH Prins
robert.ah.prins @ the.17+Gb.Google thingy
User avatar
prino
 
Posts: 536
Joined: Wed Mar 11, 2009 12:22 am
Location: Oostende, Belgium
Has thanked: 3 times
Been thanked: 21 times

Re: Get the start date of the month

Postby BillyBoyo » Tue Apr 24, 2012 1:17 pm

What format is your input date? Have you considered just setting the DD part of the date (if yours contains that) to '01'?

However, does it matter if that is a weekend/holiday?
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times

Re: Get the start date of the month

Postby jvinoth » Tue Apr 24, 2012 2:49 pm

mm/dd/yy format and its k if its weekend or holiday.
jvinoth
 
Posts: 132
Joined: Fri Nov 18, 2011 3:13 pm
Has thanked: 0 time
Been thanked: 1 time

Re: Get the start date of the month

Postby BillyBoyo » Tue Apr 24, 2012 3:59 pm

In mm/dd/yy, mm/01/yy is always the first day of the month.

  OVERLAY=(startpositionofday:C'01')


Would make the date the first of the month.

If you ever need the last day of the week, month, quarter or year, there are DFSORT functions for those. There are other DFSORT date functions, and it is worth familiarising yourself with them if you are doing date processing. There are further date manipulations in the Smart DFSORT Tricks book, available on the web.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post