View previous topic :: View next topic
|
Author |
Message |
shaktiprasad
New User
Joined: 20 Aug 2006 Posts: 34 Location: chennai
|
|
|
|
Hi ,
I want to increment the date in each record . for example
input:
2011-12-29
2011-12-30
2011-12-31
Output should be:
2011-12-30
2011-12-31
2012-01-01
I tried using ADDDAYS function , but this increments by a constant in each record. Please let me know if anybody has any idea. |
|
Back to top |
|
|
Pandora-Box
Global Moderator
Joined: 07 Sep 2006 Posts: 1592 Location: Andromeda Galaxy
|
|
|
|
Try DATE1+1 |
|
Back to top |
|
|
shaktiprasad
New User
Joined: 20 Aug 2006 Posts: 34 Location: chennai
|
|
|
|
Hi Pandora-Box,
Thanks for the reply . I think I posted it wrong for the input. correct input is as below:
2011-12-29
2011-12-29
2011-12-29
Output should be:
2011-12-30
2011-12-31
2012-01-01
will this DATE1+1 Work? |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
Quote: |
will this DATE1+1 Work? |
wouldn' t be faster to test than ask ? |
|
Back to top |
|
|
shaktiprasad
New User
Joined: 20 Aug 2006 Posts: 34 Location: chennai
|
|
|
|
Well I just tested and it isn't working |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
Quote: |
I tried using ADDDAYS function , but this increments by a constant in each record. |
that is only partially true.
you can add a constant,
or as this link shows you can also reference a field within the records (p,m,f)
take a moment and scroll down to:
Quote: |
numeric can be a decimal constant (+n or -n), or a valid numeric field
| (p,m,f) with BI, FI, ZD, PD, FS, UFF or SFF format and an
| appropriately corresponding length |
and since you are obviously technically (and personally)challenged
maybe overlay a seqnum to each record during INREC
and then do the ADDDAYS during OUTREC as well as dropping the sequence number.
Quote: |
Well I just tested and it isn't working |
and if i find in the future a post by yours that is so
basically juvenile
you will become the receiver of one of my infamous flames.
people are trying to help you,
and not only can you not describe your requirements properly,
you think that you can be cute with your answers.
i look forward to future topics started by you. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
well, Dick, what do You expect from somebody who in his profile has ...
Quote: |
Occupation: Designer
Mainframe Skills: PLAYING CRICKET ,TT,READING NEWS PAPERS |
|
|
Back to top |
|
|
shaktiprasad
New User
Joined: 20 Aug 2006 Posts: 34 Location: chennai
|
|
|
|
My objective was to increment date by 1 day in 1st record , then 2 day in 2nd and so on. This was to create a update query later on. I think I clearly mentioned that in my post.
I tried adding a seqnum after date field and based on seqnum field , I could able to create a update query with date +<seqnum> days. This solved my problem. |
|
Back to top |
|
|
|