16028 Update or Append query help
Sign Up |  Live StatsLive Stats    Articles 37,317| Comments 177,144| Members 19,403, Newest Jassi1262| Online 550
Home Contact
 (Forgotten?): 
    Sikhism
    For best SPN experience, use Firefox Internet Browser!


                                                                   Your Banner Here!    




Update or Append query help

Our Donation Goal : Why Donate? : Donate Today! : Donate Anonymously (ਗੁਪਤ) : Our Family of Supporters
Goal this month: 500 USD, Received: 115 USD (23%)
Please Donate...
     
Related Topics...
Thread Thread Starter Forum Replies Last Post
Update or Append Query help Adam Information Technology 7 28-Jul-2006 08:33 AM
Using a record set in an append query rg Information Technology 3 28-Jul-2006 08:32 AM
Re: Append Query question! Mark Cline Information Technology 2 28-Jul-2006 08:17 AM
Error running append query? Chris Burnette Information Technology 11 08-Nov-2005 12:52 PM
append query salmonella Information Technology 0 01-Nov-2005 13:40 PM


Tags
update, append, query, help
Reply Post New Topic In This Forum Stay Connected to Sikhism, Click Here to Register Now!
  #1 (permalink)  
Old 28-Jul-2006, 08:33 AM
B Miller's Avatar B Miller
Guest
 
Posts: n/a
   
   
Update or Append query help

  Donate Today!   Email to Friend  Tell a Friend   Show Printable Version  Print   Contact sikhphilosophy.net Administraion for any Suggestions, Ideas, Feedback.  Feedback  

Register to Remove Advertisements
This is probably obvious but I am a bit 'rusty' with my SQL and so I am
missing it.

I have 2 tables: Branch Daily Inventory and DAILY_INV2. Branch Daily
Inventory is branch, date, and inventory levels of various products
(structure needed for join with another table). DAILY_INV2 is an intermediary
conversion table and is branch, date, product id, quantity and storage
location.

I am trying to set the quantity for a particular product in the Branch Daily
Inventory based on the quantity value from the matching row in the DAILY_INV2
table. Here is my SQL...
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/information-technology/13037-update-or-append-query-help.html

UPDATE [Branch Daily Inventory] INNER JOIN DAILY_INV2 ON ([Branch Daily
Inventory].Date = DAILY_INV2.Date) AND ([Branch Daily Inventory].[SAP Plant
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=13037
ID] = DAILY_INV2.[SAP Plant ID]) SET [Branch Daily Inventory].[3360I] =
[DAILY_INV2].Quantity
WHERE (((DAILY_INV2.[Part Number])=3360) AND ((DAILY_INV2.[Storage
Location])="1"));

The test run lists values of all zeros which is not the correct result.

Any insight?


Got anything to share on This Topic? Why not share your immediate thoughts/reaction with us! Login Now! or Sign Up Today! to share your views... Gurfateh!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 28-Jul-2006, 08:33 AM
Ron Hinds's Avatar Ron Hinds
Guest
 
Posts: n/a
   
   
Re: Update or Append query help

"B Miller" wrote in message
news9AE0E58-C6C7-4AA9-9330-6C61652A5518@microsoft.com...
> This is probably obvious but I am a bit 'rusty' with my SQL and so I am
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=13037
> missing it.
>
> I have 2 tables: Branch Daily Inventory and DAILY_INV2. Branch Daily
> Inventory is branch, date, and inventory levels of various products
> (structure needed for join with another table). DAILY_INV2 is an

intermediary
> conversion table and is branch, date, product id, quantity and storage
> location.
>
> I am trying to set the quantity for a particular product in the Branch

Daily
> Inventory based on the quantity value from the matching row in the

DAILY_INV2
> table. Here is my SQL...
>
> UPDATE [Branch Daily Inventory] INNER JOIN DAILY_INV2 ON ([Branch Daily
> Inventory].Date = DAILY_INV2.Date) AND ([Branch Daily Inventory].[SAP

Plant
> ID] = DAILY_INV2.[SAP Plant ID]) SET [Branch Daily Inventory].[3360I] =
> [DAILY_INV2].Quantity
> WHERE (((DAILY_INV2.[Part Number])=3360) AND ((DAILY_INV2.[Storage
> Location])="1"));
>
> The test run lists values of all zeros which is not the correct result.
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=13037
>
> Any insight?


The Date column might be a datetime data type. If so, it is unlikely the two
would have the same value thus they are not practical in the JOIN. If that
is the case try removing the Date columns from the JOIN and move them to the
WHERE clause, testing for e.g.

[Branch Daily Inventory].Date > #07/06/2006# AND [Branch Daily
Inventory].Date < #07/08/2006# AND DAILY_INV2.Date > #07/06/2006# AND
DAILY_INV2.Date < #07/08/2006#

to get records for 07/07/2006


Reply With Quote
  #3 (permalink)  
Old 28-Jul-2006, 08:33 AM
B Miller's Avatar B Miller
Guest
 
Posts: n/a
   
   
Re: Update or Append query help

When I run the query as a 'select' I get records with values. But when I
test the update, I get the right number of rows but the column is 0. Silly
question, but does the update query show the results after the update or
before?


"Ron Hinds" wrote:

> "B Miller" wrote in message
> news9AE0E58-C6C7-4AA9-9330-6C61652A5518@microsoft.com...
> > This is probably obvious but I am a bit 'rusty' with my SQL and so I am
> > missing it.
> >
> > I have 2 tables: Branch Daily Inventory and DAILY_INV2. Branch Daily
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=13037
> > Inventory is branch, date, and inventory levels of various products
> > (structure needed for join with another table). DAILY_INV2 is an

> intermediary
> > conversion table and is branch, date, product id, quantity and storage
> > location.
> >
> > I am trying to set the quantity for a particular product in the Branch

> Daily
> > Inventory based on the quantity value from the matching row in the

> DAILY_INV2
> > table. Here is my SQL...
> >
> > UPDATE [Branch Daily Inventory] INNER JOIN DAILY_INV2 ON ([Branch Daily
> > Inventory].Date = DAILY_INV2.Date) AND ([Branch Daily Inventory].[SAP

> Plant
> > ID] = DAILY_INV2.[SAP Plant ID]) SET [Branch Daily Inventory].[3360I] =
> > [DAILY_INV2].Quantity
> > WHERE (((DAILY_INV2.[Part Number])=3360) AND ((DAILY_INV2.[Storage
> > Location])="1"));
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=13037
> >
> > The test run lists values of all zeros which is not the correct result.
> >
> > Any insight?

>
> The Date column might be a datetime data type. If so, it is unlikely the two
> would have the same value thus they are not practical in the JOIN. If that
> is the case try removing the Date columns from the JOIN and move them to the
> WHERE clause, testing for e.g.
>
> [Branch Daily Inventory].Date > #07/06/2006# AND [Branch Daily
> Inventory].Date < #07/08/2006# AND DAILY_INV2.Date > #07/06/2006# AND
> DAILY_INV2.Date < #07/08/2006#
>
> to get records for 07/07/2006
>
>
>

Reply With Quote
  #4 (permalink)  
Old 28-Jul-2006, 08:34 AM
B Miller's Avatar B Miller
Guest
 
Posts: n/a
   
   
Re: Update or Append query help

  Donate Today!  
When running an update query in test mode using data from another table, it
does not show the real results. When I ran the query in 'real' mode, for a
single row, it correctly updated the targeted field with the correct value;
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=13037
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=13037
in test mode, the targeted field remained at zero - the non-updated value.
Very confusing.
Reply With Quote
   Click Here to Donate Now!

Support Us!
Become a Promoter!
Gurfateh ji, you can become a SPN Promoter by Donating as little as $10 each month. With limited resources & high operational costs, your donations make it possible for us to deliver a quality website and spread the teachings of the Sri Guru Granth Sahib Ji, to serve & uplift humanity. Every contribution counts. Donate Generously. Gurfateh!
ReplyPost New Topic In This Forum Stay Connected to Sikhism, Click Here to Register Now!

Bookmarks


(View-All Members who have read this thread : 0
There are no names to display.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Tools Search
Search:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On

» Active Discussions
30 Day Amrit Vel 'a'...
Today 12:43 PM
33 Replies, 323 Views
Do you believe in...
Today 12:00 PM
184 Replies, 3,818 Views
What Do You Think of...
Today 11:59 AM
36 Replies, 626 Views
Thought of the Moment!
Today 10:07 AM
109 Replies, 5,111 Views
Amrit
Today 09:17 AM
5 Replies, 353 Views
Losing My Religion: Why...
By Akasha
Today 07:19 AM
2 Replies, 74 Views
What I believe Hukam to...
Today 03:15 AM
13 Replies, 149 Views
Should SPN Keep the...
Today 02:02 AM
19 Replies, 562 Views
Rozana Reports (ਪੰਜਾਬੀ...
Today 01:46 AM
304 Replies, 7,486 Views
Sikh Spokesman (ਪੰਜਾਬੀ...
Today 01:18 AM
173 Replies, 4,389 Views
Student Compares Toilet...
Today 01:05 AM
1 Replies, 67 Views
Map shows world's 'most...
Yesterday 18:58 PM
16 Replies, 284 Views
BHOOTS (Ghosts) and...
Yesterday 13:08 PM
102 Replies, 13,893 Views
How does Sikhi help you...
Yesterday 12:44 PM
17 Replies, 711 Views
Why are There so Many...
Yesterday 10:23 AM
70 Replies, 5,071 Views
» Books You Should Read...
Powered by vBadvanced CMPS v3.2.3
All times are GMT +6.5. The time now is 12:49 PM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.
Search Engine Optimization by vBSEO 3.6.0 PL2 Copyright © 2004-12, All Rights Reserved. Sikh Philosophy Network


Page generated in 0.38612 seconds with 32 queries
0