View Full Version : assign the value at run time in SQL query


patelnitesha
08-28-2007, 04:44 AM
hi..

i want to use this query into my code..

DoCmd.RunSQL "INSERT INTO joint_ledger (owner_ref, value_settled, ClientONo, trans_against, con_veh,) VALUES (" & G_current_client & "," & (G_value_os = 0) & " , '" & G_clientono & "', " & jjref & ",'" & con & "')

the part of statement highlighted in red ...is the value for the filed value_settled whose data type is yes/no..

now i am confused with thise highlighted part..will it assign the 0 to G_value_os or first use the original value of G_value_os to insert the value into database... please help me...

many thanks...

Dennisk
08-28-2007, 06:25 AM
the expression will be evaluated to true or false and that should be inserted.

patelnitesha
08-29-2007, 12:03 AM
i know that but...

i wanted to know that what will be first executed ...will it assign the 0 to G_value_os or first use the Yes/No according to original value of G_value_os to insert the value into database...

Dennisk
08-29-2007, 12:09 AM
no it a boolean expression it will ask' is G_value_os = 0' and return true or false

if you require an assignment then place this on a seperate line.

patelnitesha
08-30-2007, 12:07 AM
thank you very much.