aegregory
Posts: 7
|
| Posted: 05/12/2006, 2:04 PM |
|
I'm using CCS3, SQL Server, and ASP. My record form uses the following custom insert statement. The [Dispute_Date_Received] is not a mandatory field. If the field is populated with a date, the statement works. If it is empty I get the error saying Line 1: Incorrect syntax near ','. (Microsoft OLE DB Provider for SQL Server).
I think that SQL Server is seeing two consecutive commas if the [Dispute_Date_Received] field is empty. How do I get around this? I tried putting NULL and 'NULL' in the default value field of the parameter.
IF '{DebitCredit}'=1 begin INSERT INTO Dispute_Data (Customer_Name, Acct_No, Dispute_Amt, Dispute_Type_Id, Dispute_Status_ID, Dispute_Bucket, RespOrg_ID, Dispute_Reason_ID,Dispute_Date_Received, Dispute_Date_Completed, Dispute_Org, Dispute_Alliance,
Dispute_Legal, AE_ID, Dispute_ApprovedBy, Dispute_EBM, Dispute_Comment, Dispute_Region, Dispute_SM, Dispute_RSVP, OM_Accepted)
VALUES ('{Customer_Name}', '{Acct_No}', ABS({Dispute_Amt})*-1, '{DebitCredit}', {Dispute_Status_ID}, '{Dispute_Bucket}', {RespOrg_ID}, {Dispute_Reason_ID}, '{Dispute_Date_Received}', '{Dispute_Date_Completed}', '{Dispute_Org}', '{Dispute_Alliance}', '{Dispute_Legal}', '{AE_ID}', '{Dispute_ApprovedBy}', '{Dispute_EBM}', '{Dispute_Comment}', '{Dispute_Region}', '{Dispute_SM}', '{Dispute_RSVP}', '{OM_Accepted}') end
|
 |
 |
TheunisP
Posts: 342
|
| Posted: 05/16/2006, 5:29 AM |
|
I'm not sure how the error occurs - but why not give the text box a default value with Date() or Now()?
|
 |
 |
|