Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / General 1 / August 2006

Tip: Looking for answers? Try searching our database.

Update query on the basis of three variables

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Eric - 23 Aug 2006 16:38 GMT
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,
pietlinden@hotmail.com - 23 Aug 2006 20:22 GMT
Yuck.  Normalize and your problems will go away.  The update will be
simple.
pietlinden@hotmail.com - 23 Aug 2006 20:23 GMT
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.
Jeff L - 23 Aug 2006 20:25 GMT
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));

> In tbl_EquipmentChronology there are three variables Equipment1,
> Equipment2, Equipment3. My query worsk fine but on the basis of
[quoted text clipped - 5 lines]
> 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,
Arno R - 24 Aug 2006 13:35 GMT
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

> In tbl_EquipmentChronology there are three variables Equipment1,
> Equipment2, Equipment3. My query worsk fine but on the basis of
[quoted text clipped - 11 lines]
>
> Thanks,
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.