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

Update query on the basis of three variables

P: n/a
In tbl_EquipmentChronology there are three variables Equipment1,
Equipment2, Equipment3. My query worsk fine but on the basis of
[tbl_EquipmentChronology].[Equipment1] as i have to check if Equipment2
has a value then instead of Equipment1 i have to grab Equipment2 value
or if Equipment3 has a value i have to grab from Equipment3. How to i
change my query.

UPDATE tbl_Events INNER JOIN tbl_EquipmentChronology ON
tbl_Events.TicketNum = tbl_EquipmentChronology.TicketNum SET

tbl_Events.txt = [tbl_EquipmentChronology].[Equipment1]
WHERE (((tbl_Events.PPVVOD_Outlet)=[Tbl_EquipmentChronology].[Outlet]
And (tbl_Events.PPVVOD_Outlet)<>0));

Thanks,

Aug 23 '06 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Yuck. Normalize and your problems will go away. The update will be
simple.

Aug 23 '06 #2

P: n/a
Yuck. Normalize and your problems will go away. The update will be
simple.
Any time you have FieldName1, FieldName2, FieldName3,... you should
recognize the problem. These should all be values in a child table.
Then querying etc is easy.

If you want really fun, try doing filters and updates for tables
structured like this.

Glad it's you using that DB and not me.

Aug 23 '06 #3

P: n/a
UPDATE tbl_Events a INNER JOIN tbl_EquipmentChronology b ON
aTicketNum = b.TicketNum
SET a.txt = IIF(Not IsNull(b.Equipment3), b.Equipment3, iif(Not
IsNull(b.Equipment2), b.Equipment2,b.Equipment1))
WHERE (((tbl_Events.PPVVOD_Outlet)=[Tbl_EquipmentChronology].[Outlet]
And (tbl_Events.PPVVOD_Outlet)<>0));

Eric wrote:
In tbl_EquipmentChronology there are three variables Equipment1,
Equipment2, Equipment3. My query worsk fine but on the basis of
[tbl_EquipmentChronology].[Equipment1] as i have to check if Equipment2
has a value then instead of Equipment1 i have to grab Equipment2 value
or if Equipment3 has a value i have to grab from Equipment3. How to i
change my query.

UPDATE tbl_Events INNER JOIN tbl_EquipmentChronology ON
tbl_Events.TicketNum = tbl_EquipmentChronology.TicketNum SET
tbl_Events.txt = [tbl_EquipmentChronology].[Equipment1]
WHERE (((tbl_Events.PPVVOD_Outlet)=[Tbl_EquipmentChronology].[Outlet]
And (tbl_Events.PPVVOD_Outlet)<>0));

Thanks,
Aug 23 '06 #4

P: n/a
Why are you not listening ??
Please do NOT multipost !!!!

If you *have to* then crosspost.
Multi-posting really is wasting people's time.

Arno R
"Eric" <eh******@gmail.comschreef in bericht news:11**********************@h48g2000cwc.googlegr oups.com...
In tbl_EquipmentChronology there are three variables Equipment1,
Equipment2, Equipment3. My query worsk fine but on the basis of
[tbl_EquipmentChronology].[Equipment1] as i have to check if Equipment2
has a value then instead of Equipment1 i have to grab Equipment2 value
or if Equipment3 has a value i have to grab from Equipment3. How to i
change my query.

UPDATE tbl_Events INNER JOIN tbl_EquipmentChronology ON
tbl_Events.TicketNum = tbl_EquipmentChronology.TicketNum SET

tbl_Events.txt = [tbl_EquipmentChronology].[Equipment1]
WHERE (((tbl_Events.PPVVOD_Outlet)=[Tbl_EquipmentChronology].[Outlet]
And (tbl_Events.PPVVOD_Outlet)<>0));

Thanks,
Aug 24 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.