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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

need help with an IIF statement

Status
Not open for further replies.

scarter1456

Programmer
Mar 26, 2015
2
CA
HI

I found the IIF statement that I cannot understand and would like if someone could explain it to me. I think it's incorrect but I'm fairly new to VB6 and SQl.
strSQL = strSQL & "UPDATE Soumission SET IndSoumis = " & IIf(bEstSoumis = True, "1, DateSoumis = '" & Now & "' "
Thanks in advance for any clarity you can provide to explain this IIF to me.
 
>the syntax would have to be:


No, it wouldn't. As guitarzan says, syntactically it is fine as it is.
 
My apology, they are the same statements.
I guess I was so stuck on my way of seeing it that I could not see it the other way.
[purpleface]

Have fun.

---- Andy

A bus station is where a bus stops. A train station is where a train stops. On my desk, I have a work station.
 
I find thay putting Now in a query string without the quotes and & works anyway. ( Datesoumis = Now )
When I use an external variable I put ( Datesoumis = #" & Mydate & "# ) in which case Mydate is a specific date that could change.
To be sure I also check beforehand that Mydate is really a valid date or set it to Null if not otherwise you get an error.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top