Increment date in script


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Increment date in script
# 1  
Old 12-22-2009
Java Increment date in script

Hi,
Iam new to scripting language.Smilie
can someone help me out solving this thread?hopingly ya....Smilie
I want to write a script which connects to db and searches the count in a table which has date column and id column.
If the count is not equal to 0 then it should increment the date with the one which is in the table.
suppose the table has date as 12-12-2009 then the script should increment the date to 13-12-2009.

Thanks and Regards,
JyothiSmilie
jyothi_wipro
# 2  
Old 12-22-2009
First question which db - oracle, sybase...?
# 3  
Old 12-22-2009
Iam using Mysql database.
jyothi_wipro
# 4  
Old 12-22-2009
Code:
mysql> SELECT ADDDATE('2009-01-02', 1);
        -> '2009-01-03'


Last edited by jim mcnamara; 12-22-2009 at 06:34 AM..
# 5  
Old 12-22-2009
Thanks a lot....
jyothi_wipro
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Script to find a date variable and increment it

Hi, I have parameter file wo_location.prm which has a date variable $last_upd_date= 02032016. I need to write a unix shell script to find that variable and increment it by 1 day. The path to the file is root/dir_lc/shared/param/wo_location.prm and the variable is $last_upd_date. Any... (2 Replies)
Discussion started by: isenhiem
2 Replies

2. Shell Programming and Scripting

How to increment date using "for loop" in format MMDDYY inside the shell script?

Need to increment the date from "currentdate + 90days" inside the for loop (i=1 to i=50) (5 Replies)
Discussion started by: aroragaurav.84
5 Replies

3. Shell Programming and Scripting

how to update date part with new increment date time

hi experts, my requirement is like this i need to develop a shell script to update date part with new incremental date time in file some 'X' which is kept at some server location incrementing every two hours.as i am new to this scripting i need support from u people,thanx in advance (1 Reply)
Discussion started by: amanmro
1 Replies

4. Shell Programming and Scripting

Date increment

hi Friends, Today_Dt=`date "+%Y-%m-%d"` So the Today date is 2010-05-03 I have a file which has date values as below 2010-04-27 2010-04-02 2010-04-18 2010-04-28 2010-04-29 .. (1 Reply)
Discussion started by: Gopal_Engg
1 Replies

5. Shell Programming and Scripting

Increment in date

Hi, I have a variable lets say DATA_DATE. I have to pass some value to this variable in YYYYMMDD format. lets say today I have passed this variable as : DATA_DATE=20100107 Then pls help me how to calculate another variable DATA_DATE1 (which is DATA_DATE+1). The code should work... (3 Replies)
Discussion started by: 46019
3 Replies

6. Shell Programming and Scripting

Increment a date variable in perl script

Hi, I have a perl script which prints epoch value of date in milliseconds as the output. My reuirement is that once the output is printed,the day variable shld increment by 1 and when i execute the script for the second time the output shld be for the new day value. My script looks as... (11 Replies)
Discussion started by: jyothi_wipro
11 Replies

7. Shell Programming and Scripting

How to increment a user defined date value in the DATE format itself using shell script?

I need to increment a date value through shell script. Input value consist of start date and end date in DATE format of unix. For eg. I need increment a date value of 1/1/09 to 31/12/09 i.e for a whole yr. The output must look like 1/1/09 2/2/09 . . . 31/1/09 . . 1/2/09 . 28/2/09... (1 Reply)
Discussion started by: sunil087
1 Replies

8. Shell Programming and Scripting

Can we increment or decrement a date value?

export a=`date` a=`expr $a + 1` Is it possible? if not how can i increment or decrement a date variable? (2 Replies)
Discussion started by: arghya_owen
2 Replies

9. Shell Programming and Scripting

Shell Script To increment Date*HElp***

Hi, I want to increment date, using Shell Script, a loop to add one day after 24hrs. :confused: Cheers Kunal (1 Reply)
Discussion started by: niceboykunal123
1 Replies

10. Shell Programming and Scripting

Increment date in 'for' loop?

Hi Guys, My first post..:) Right...I want to move existing files (with some date in their name) currently in $mainftp, to $mainfolder/$foldate/system1. I'd like to be able to increment date in the for loop? Is this possible or should I use a different technique. The script return the... (4 Replies)
Discussion started by: SunnyK
4 Replies
Login or Register to Ask a Question