01-14-2009 08:15 PM
Hi,
I am trying to use a variable in an sql statement and I have run into problems when the variable is a number. The following line of code works if the variable is a string but not if it is a number.
"SELECT TOP 1 UUT_STATUS FROM UNIT_UUT_RESULT WHERE UnitID = '" + Locals.LocalUnitID + "' ORDER BY START_DATE_TIME DESC"
Is there a difference in the use of the single and double quotes and the + sign for number variables?
Thanks
Stuart
01-15-2009 07:39 AM
I'm no expert but I don't believe you need to surround a number within the single speech marks but text does need them. i.e. items in red are not needed.
"SELECT TOP 1 UUT_STATUS FROM UNIT_UUT_RESULT WHERE UnitID = '" + Locals.LocalUnitID + "' ORDER BY START_DATE_TIME DESC"
Kevin
01-15-2009 08:52 AM
Duplicate Thread
Stuart is right, refer to my post on the TestStand forum:
http://forums.ni.com/ni/board/message?board.id=330&thread.id=22694