Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Here is a query i wrote...but it's syntax is not correct 1

Status
Not open for further replies.

chaos18

IS-IT--Management
Dec 31, 2002
32
US
My Query:
If [Image_Source] = "\Images\Not Available\" Then If [Source_ID] = "37**" Or "38**" Then Set [Image_Source] = "\Images\Microfiche"

I'm aware that this is writtten horribly wrong, but as i am not acquainted with using SQL to write queries i think it serves well enough to show what i am attempting to do...
 
Is this a query against a database table?

Does [Source_ID] = "37**" Or "38**" mean 37 or 37 plus two of anything else?
 
it means 37 and two of anything else
 
and yes it is a query against a database
 
If the 37?? is a text field, the line should read:

If [Image_Source] = "\Images\Not Available\" Then If ([Source_ID] = Like ' & "37*" & ' Or [Source_ID] = Like ' & "38*" & "'") Then Set [Image_Source] = "\Images\Microfiche"


Only two things are infinite, the universe and human stupidity, and I'm not sure about the former. (Albert Einstein)

Robert L. Johnson III, MCSA, Network+, A+
Access Developer/Programmer
robert.l.johnson.iii@citigroup.com
 
Okay, I think you are trying to write an update statement.

UPDATE <table name>
SET IMAGE_SOURCE = &quot;\Images\Microfiche&quot;
WHERE IMAGE_SOURCE = &quot;\Images\Not Available\&quot;
AND (SOURCE_ID LIKE &quot;37*&quot; OR SOURCE_ID LIKE &quot;38*&quot;
AND <maybe a record key>

This query will update anything that starts with a 37 or 38 (i.e. 3712653654).

<table name> = the name of the table
<maybe a record key> = id of the record to update
 
thank you for your help...it is greatly appreciated
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top