Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Microsoft Access > Null dates in I...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 3 Topic 30410 of 31576
Post > Topic >>

Null dates in Insert Into statement

by "paulquinlan100@[EMAIL PROTECTED] " <paulquinlan100@[EMAIL PROTECTED] > May 30, 2008 at 06:22 AM

Hi

I'm trying to execute the following code:

    sSQL = "insert into lkpChanges
(SiteRef,ProjectName,InvestmentType,FieldChanged,PreviousDate,NewDate,ChangeDate,CurrentRelaunch)
" & _
            "values (" & sRef & ", """ & pName & """,""" & iType &
""",""" & fChange & """," & IIf(IsNull(pDate), Null, pDate) & "," &
IIf(IsNull(txtFSOS), Null, txtFSOS) & "," & Date & "," &
IIf(IsNull(txtFRelaunch), Null, txtFRelaunch) & ");"

    DoCmd.RunSQL sSQL

which evaluates to:

insert into lkpChanges
(SiteRef,ProjectName,InvestmentType,FieldChanged,PreviousDate,NewDate,ChangeDate,CurrentRelaunch)
values (572, "Accrington","New","SOS",,02/01/2008,30/05/2008,);

However, i get the message "Syntax error in Insert Into statement"

I presume this is due to the null dates. Is there anyway around this?

Thanks
Paul
 




 3 Posts in Topic:
Null dates in Insert Into statement
"paulquinlan100@[EMA  2008-05-30 06:22:17 
Re: Null dates in Insert Into statement
"Allen Browne"   2008-05-30 22:20:29 
Re: Null dates in Insert Into statement
Arch <send.no@[EMAIL P  2008-05-30 10:25:50 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Tue Dec 2 22:58:11 CST 2008.