Page 1 of 1

System variables %%Date %%Time

Posted: 09 Sep 2009 7:44
by chand
Hi,

I know we can do this:

AutoEdit Assignment
%%A=%%CALCDATE %%DATE -5
%%A=%%SUBSTR %%A 3 4

Command Line:
<program> %%A

I would like do a Time calculation, and could not find the equivalent codes or example, such as:

AutoEdit Assignment
%%A=%%CALCTIME %%TIME +5 (in minutes)
%%A=%%SUBSTR %%A 1 5

Command Line:
<program> %%A (the expected output time, ie. 21:05)

Could anyone please help me what is the best way to get the time. Many thanks.

Posted: 09 Sep 2009 3:03
by philmalmaison
wich database ?
because in sybase i have another way to do it by script
as you can calculate time base on DATETIME using the following:

SQL -U<emuser> -P<pass>
select getdate()
go

and using the dateadd function :
SQL -U<emuser> -P<pass>
select dateadd(mi,-30,getdate())
go

result :
1> select getdate()
2> go

--------------------------
Sep 9 2009 3:00PM

(1 row affected)
1>

1> select dateadd(mi,-30,getdate())
2> go

--------------------------
Sep 9 2009 2:32PM

(1 row affected)
1>

mi representing minutes


regards
philmalmaison




regards
philmalmaison