Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Adding fictitious line numbers to Invoice Expand / Collapse
Author
Message
Posted Monday, August 26, 2013 9:07 AM
SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Yesterday @ 6:26 AM
Points: 97, Visits: 504
Hello,

I am trying to think of a method to append fictitious line numbers to Invoice data without them.
I am working on consolidating invoice data from several systems and one of them unfortunately does not have invoice line numbers.

So, for all my systems that do, I a return similar to this;

Line # InvoiceNumber
1 12345
2 12345
3 12345

For the one system that doesn't, I get this;

Line # InvoiceNumber
NULL 12345
NULL 12345
NULL 12345

What I'd like to do is "simply" add a line number to invoice 12345 so it would look like the above example. Any ideas would be welcomed. Thanks

Post #1488416
Posted Monday, August 26, 2013 9:12 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Today @ 2:50 PM
Points: 13,325, Visits: 12,811
Use ROW_NUMBER. http://technet.microsoft.com/en-us/library/ms186734.aspx

_______________________________________________________________

Need help? Help us help you.

Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.

Need to split a string? Try Jeff Moden's splitter.

Cross Tabs and Pivots, Part 1 – Converting Rows to Columns
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs
Understanding and Using APPLY (Part 1)
Understanding and Using APPLY (Part 2)
Post #1488422
Posted Monday, August 26, 2013 9:55 AM
SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Yesterday @ 6:26 AM
Points: 97, Visits: 504
Thank you. That worked perfect.
Post #1488438
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse