Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Date variables using the ACCEPT statement.

Status
Not open for further replies.

stefanvg

Programmer
Feb 20, 2002
1
NZ
Hi there

I am writing an script to update a set of tables. I need to insert DATE1 in one column and the date just before in another, lets say DATE2.

Code appears as follows:

PROMPT Please enter the required date;
ACCEPT DATE1 DATE PROMPT 'Date: ';
PROMPT The date will be set to &DATE1
PROMPT

UPDATE Table1
SET D1_DATE = '&DATE1',
D2_DATE = '&DATE1' - 1;

The calculation does not return the date I need - DATE2 stays the same as DATE1. Do I need to use some kind of data conversion statement??? Am I approaching this right in the first place?

Help would be appreciated!

Cheers

:)
 
with this script you get date2=date1 - 1 day

is it what you need ?
If not you have to use the appropriate functions to manipulate date.....
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top