Update query bombs with "1.5.2" but not with "1.5"

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm trying to update values in a "parent" table when the status of a "child"
changes. The data is version number strings - "1.0, 1.5.2, 11.2.13" etc. The
field definitions are identical in both tables.

The update query is formed dynamically by reading values from a recordset.
The individual queries in a sample case and the resulting update in the
target table are:

UPDATE tblAppSubSystems SET tblAppSubSystems.appSubSysVer = 1.0 WHERE
tblAppSubSystems.appSubSysID = 10 ---- WRITTEN AS "1"
UPDATE tblAppSubSystems SET tblAppSubSystems.appSubSysVer = 1.5.2 WHERE
tblAppSubSystems.appSubSysID = 15 ---- WRITTEN WRONG AS "0"
UPDATE tblAppSubSystems SET tblAppSubSystems.appSubSysVer = 1.1.2 WHERE
tblAppSubSystems.appSubSysID = 16 ----WRITTEN WRONG AS "0"
UPDATE tblAppSubSystems SET tblAppSubSystems.appSubSysVer = 1.2 WHERE
tblAppSubSystems.appSubSysID = 18 ---- WRITTEN CORRECT AS "1.2"
 
Someone much smarter than I will probably post a proper answer, but if the
fields are numbers, can there be more than one decimal point?

If it's a string/text, what if you enclose the value in quotes?
ie. ... SET tblAppSubSystems.appSubSysVer = "1.1.2" WHERE ...

Jay
 
Thanks...how I get quotes into the dynamically formed query? Thats where I'm
stuck at the moment
 
I'm not sure if I understand, but if you need to input a double-quote into a
string, you can use Chr(34)

"UPDATE tblAppSubSystems SET tblAppSubSystems.appSubSysVer = " & Chr(34) &
"1.0 WHERE...."

My apologies if I've completely missed the problem.
 
Thanks! That worked like a charm...

Jay said:
I'm not sure if I understand, but if you need to input a double-quote into a
string, you can use Chr(34)

"UPDATE tblAppSubSystems SET tblAppSubSystems.appSubSysVer = " & Chr(34) &
"1.0 WHERE...."

My apologies if I've completely missed the problem.
 
Back
Top