changing a value in one field base on a vlaue in another field

G

Guest

In my table I hve a field named photoCount, which contains the total number
of photos related to this record, and one called Photo, which gives the name
of the first photo (this is based on oanother field).

I need the synatx for:

if the value in photoCount = 0 then
the name of the photo in Photo is 1.jpg

Thanks in adance
 
M

[MVP] S.Clark

SELECT IIF(PhotoCount=0, "1.jpg", [Photo]) From Tablename

Another option to make it more permanant:

Update Tablename Set [Photo] = "1.jpg" WHERE PhotoCount = 0
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top