CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> ASP

 default date in custom insert statement

Print topic Send  topic

Author Message
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
View profile  Send private message
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()?

View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.