Click here to Skip to main content
15,909,199 members
Home / Discussions / Database
   

Database

 
GeneralRe: Bulk Data Import Pin
Wendelius15-Aug-08 5:51
mentorWendelius15-Aug-08 5:51 
GeneralRe: Bulk Data Import Pin
Mycroft Holmes15-Aug-08 14:11
professionalMycroft Holmes15-Aug-08 14:11 
GeneralRe: Bulk Data Import Pin
Wendelius15-Aug-08 21:01
mentorWendelius15-Aug-08 21:01 
QuestionNeed some help copying a column Pin
MarkB77714-Aug-08 14:57
MarkB77714-Aug-08 14:57 
AnswerRe: Need some help copying a column Pin
Mycroft Holmes14-Aug-08 15:12
professionalMycroft Holmes14-Aug-08 15:12 
GeneralRe: Need some help copying a column Pin
MarkB77714-Aug-08 15:25
MarkB77714-Aug-08 15:25 
GeneralRe: Need some help copying a column Pin
Mycroft Holmes14-Aug-08 15:37
professionalMycroft Holmes14-Aug-08 15:37 
QuestionUpdate values based on non-matched records Pin
empulse14-Aug-08 13:28
empulse14-Aug-08 13:28 
I have been trying to make this work, but so far no luck. Probably an easy one for someone with a bit more experience. Here is a simplified explanation.

I have two tables, the primary table is an inventory table listing items identifed by a unique inventory number and the second is a record of transactions. A record is added to the second table when a transaction occurs that affects an item in the first table. For instance when an item is sold, a transaction is created in the transaction table - "Sold" designated by the letter "S", a new item received is designated with the letter "R" etc. Occasionally an item is listed as "received" that is already in the inventory table or an item is listed as "sold" that is was not entered in the inventory table.

I need to do two things: (1) Find the records in the second table (t_log) that do not have a matching inventory number in the Inventory table and insert appropriate text into a comment field. (2) find the records in the transaction table with 'R' transaction type and insert an appropriate comment in the transaction table. In each case I need to set a boolean to to True (error).

The tables look like this:
----------------
Inventory Table (Inv)
-----------------------
InventoryNo
Name, etc.

-------------------
TransactionLog (T_Log)
-----------------------
InvNo
TransactionType
Comment
Error (Boolean)
------------------

For the records that are in the T_Log but not in the inventory (Table A), the query below displays the records that I want to update, but I don't know how to update just those records.

(select Inv.InventoryNo,Inv.ItemName,T_Log.id, T_Log.Invno,t_log.transactiontype, t_log.commment
FROM Inv
RIGHT OUTER JOIN T_Log on InventoryNo = Invno
WHERE Inv.InventoryNo is NULL )

Thanks for any help
AnswerRe: Update values based on non-matched records Pin
Mycroft Holmes14-Aug-08 15:18
professionalMycroft Holmes14-Aug-08 15:18 
GeneralRe: Update values based on non-matched records Pin
empulse14-Aug-08 15:53
empulse14-Aug-08 15:53 
GeneralRe: Update values based on non-matched records Pin
Mycroft Holmes14-Aug-08 16:03
professionalMycroft Holmes14-Aug-08 16:03 
GeneralRe: Update values based on non-matched records Pin
empulse14-Aug-08 16:06
empulse14-Aug-08 16:06 
QuestionT-SQL Help Pin
RG_SA14-Aug-08 12:28
RG_SA14-Aug-08 12:28 
AnswerRe: T-SQL Help Pin
Colin Angus Mackay14-Aug-08 12:44
Colin Angus Mackay14-Aug-08 12:44 
GeneralRe: T-SQL Help Pin
RG_SA14-Aug-08 20:36
RG_SA14-Aug-08 20:36 
GeneralRe: T-SQL Help Pin
Colin Angus Mackay14-Aug-08 21:15
Colin Angus Mackay14-Aug-08 21:15 
GeneralRe: T-SQL Help Pin
RG_SA15-Aug-08 0:50
RG_SA15-Aug-08 0:50 
GeneralRe: T-SQL Help Pin
Colin Angus Mackay15-Aug-08 1:24
Colin Angus Mackay15-Aug-08 1:24 
GeneralRe: T-SQL Help [modified] Pin
RG_SA15-Aug-08 2:16
RG_SA15-Aug-08 2:16 
GeneralRe: T-SQL Help Pin
Wendelius15-Aug-08 8:27
mentorWendelius15-Aug-08 8:27 
QuestionSQL Express 2005 - Visual Studio 2008 Pin
Ed.Poore14-Aug-08 8:25
Ed.Poore14-Aug-08 8:25 
AnswerRe: SQL Express 2005 - Visual Studio 2008 Pin
Wendelius14-Aug-08 8:45
mentorWendelius14-Aug-08 8:45 
GeneralRe: SQL Express 2005 - Visual Studio 2008 Pin
Ed.Poore14-Aug-08 11:12
Ed.Poore14-Aug-08 11:12 
GeneralRe: SQL Express 2005 - Visual Studio 2008 Pin
Wendelius15-Aug-08 4:28
mentorWendelius15-Aug-08 4:28 
GeneralRe: SQL Express 2005 - Visual Studio 2008 Pin
Ed.Poore15-Aug-08 22:52
Ed.Poore15-Aug-08 22:52 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.