main logo
Subject: RE: Select for differences in a transaction table.
Author: Stephen Russell
Posted: 2005/08/31 13:44:13
 
View Entire Thread
New Search




Stephen Russell <mailto:SRussell at transactiongraphics D.O.T com> wrote:
> I am trying to compare 2 SETS of order detail data from the same
> customer to see if there is a change. Basically we print checks and
> I'm looking for a quick report for customers whose name& address data
> changed thus a new batch
> of checks were printed.
>
>
> Schema for table is:
>
> CREATE TABLE [dbo].[ORDER_CHECK_CARD] (
> [OrderId] [int] NOT NULL ,
> [LineNum] [tinyint] NOT NULL ,
> [LineText] [varchar] (56) COLLATE SQL_Latin1_General_CP1_CI_AS NOT
> NULL , [Bold] [char] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NOT
> NULL ) ON [PRIMARY]
>
> This table will have 6 transactions per ORDERID, some empty, other
> with data.
>
> My task is to query the accounts table, join the orders table, and
> define if a change was made in the date range the user supplies
> (think yearly report)
>
> Anyone have a clue on this SQL? I have drank too much coffee and
> have to large a headache now.

This shows 2 orders for same person who moved. Can you see a query that
returns an int for the line # that was changed 0 for no change?

3096421
1 Tommy G. Tunes Y
2 7909 Bradyhill PH. 901-377-3572 N
3 Cordova, TN 38018 N
4 N
5 N
6 N
3105334
1 Tommy G. Tunes Y
2 6327 Bardstown Rd N
3 Bartlett, TN 38134 N
4 N 3105334
5 N 3105334
6 N

If Tommy just removed his phone # that would be good enough for a #2 return.


Stephen Russell
DBA/Developer
Transaction Graphics Inc.

Office: 901.312.7621
Fax: 901.312.7655

srussell@transactiongraphics.com

This message is intended exclusively for the individual or entity to which it is addressed. This communication may contain information that is proprietary, privileged or confidential or otherwise legally prohibited from disclosure. If you are not the named addressee, you are not authorized to read, print, retain, copy or disseminate this message or any part of it. If you have received this message in error, please notify the sender immediately by e-mail and delete all copies of the message.


This message has been scanned by Modus Gate Anti-Virus/Spam technology.




 
©2005 Stephen Russell
<-- Prior Message New Search Next Message -->