Forum Moderators: coopster & phranque

Message Too Old, No Replies

inserts into SQL 2000 Dates and Nulls

Dates and Nulls formating issues

         

Dart

2:56 pm on Oct 30, 2007 (gmt 0)

10+ Year Member



I have an issue with the formating of date fields. SQL2000 requires the a date to be inside single quotes. I am trying to use an if statement to validate Null and date fields:

if ($FORM{TX_DT})
{
&datechecks($FORM{TX_DT}, 'TX');
$TX_DT = $FORM{TX_DT};
}
else
{
$TX_DT = NULL;
}
I need the correct way to put the value $FORM{TX_DT} in single quotes.

also can anyone tell me the best way to test the scripts I am very new with this.

Thanks

jatar_k

3:16 pm on Oct 30, 2007 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Welcome to WebmasterWorld Dart,

wouldn't this work?

$TX_DT = "'" . $FORM{TX_DT} . "'";

Dart

4:11 pm on Oct 30, 2007 (gmt 0)

10+ Year Member



thanks,

that is correct It works.

phranque

10:39 pm on Oct 30, 2007 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



welcome to WebmasterWorld, dart!