By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,863 Members | 879 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,863 IT Pros & Developers. It's quick & easy.

sql string questions

P: n/a
I'm having a few problems with strings and I think it's as to how they're
compared.

for example this query:

update [addresses]
set [country code] = ""
where [country code] not in (select countrycode from country)

does not update any records, despite the fact I know there are country code
entries in the addresses table that are not in the country table.
Also, should the following not equal comparator work as is obviously
intended? It doesn't seem to work for me!

where field <> 'whatimlookingfor'

This is just using SQL in the query window, not within vba.

Cheers all,
Chris

Nov 12 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a

"Chris L Humphreys" <cl*********@toofgib.moc> scribbled in message
news:bk**********@ucsnew1.ncl.ac.uk...
I'm having a few problems with an update query.....
update [addresses]
set [country code] = ""
where [country code] not in (select countrycode from country)

does not update any records, despite the fact I know there are country code entries in the addresses table that are not in the country table.

Also, should the following not equal comparator work as is obviously
intended? It doesn't seem to work for me!

where field <> 'whatimlookingfor'

This is just using SQL in the query window, not within vba.

Cheers all,
Chris


Hi Chris,

update [addresses] Set [country code] = "" this updates the addresses table,
either you typo'd your question or I read it wrong. Which table are you
trying to update?
For where field <> 'whatimlookingfor'

use where field <'whatimlookingfor' OR where field > 'whatimlookingfor' NOT
on the same line in the Access QBE grid, use 2 seperate lines

HTH,

Regards,

Andy.
Nov 12 '05 #2

P: n/a
"Andy" <sy************@NOSPAM.ntlworld.com> wrote in message
news:Bw****************@newsfep4-winn.server.ntli.net...
"Chris L Humphreys" <cl*********@toofgib.moc> scribbled in message
news:bk**********@ucsnew1.ncl.ac.uk...
update [addresses]
set [country code] = ""
where [country code] not in (select countrycode from country)

update [addresses] Set [country code] = "" this updates the addresses table, either you typo'd your question or I read it wrong. Which table are you
trying to update?
the addresses has a country code field, which should be a code which is also
present in the country table, under countrycode.
Many codes are incorrect and I want them removed.
For where field <> 'whatimlookingfor'

use where field <'whatimlookingfor' OR where field > 'whatimlookingfor' NOT on the same line in the Access QBE grid, use 2 seperate lines


cheers. Is is normal for <> to not work with strings?

Thanks,
Chris
Nov 12 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.