Click here to Skip to main content
15,897,371 members
Home / Discussions / Database
   

Database

 
AnswerRe: data access that apply for and data source Pin
Pete O'Hanlon3-Apr-07 2:39
mvePete O'Hanlon3-Apr-07 2:39 
GeneralRe: data access that apply for and data source Pin
Hassan Amaar3-Apr-07 4:26
Hassan Amaar3-Apr-07 4:26 
GeneralRe: data access that apply for and data source Pin
Pete O'Hanlon3-Apr-07 4:42
mvePete O'Hanlon3-Apr-07 4:42 
QuestionMerge 3 datatables into 1 data table Pin
steve_rm2-Apr-07 23:14
steve_rm2-Apr-07 23:14 
AnswerRe: Merge 3 datatables into 1 data table Pin
Paddy Boyd3-Apr-07 1:15
Paddy Boyd3-Apr-07 1:15 
AnswerRe: Merge 3 datatables into 1 data table Pin
Vinay Dornala3-Apr-07 1:59
Vinay Dornala3-Apr-07 1:59 
AnswerRe: Merge 3 datatables into 1 data table Pin
Jaiprakash M Bankolli3-Apr-07 7:45
Jaiprakash M Bankolli3-Apr-07 7:45 
QuestionMerging multiple columns into one Pin
Alex Feature2-Apr-07 22:09
Alex Feature2-Apr-07 22:09 
hello guys.

i have a question i was hoping someone would be able to help me with. here is my problem:

i have a database with 3 tables, one called CustomerInfo, one called Invoices, and one called CreditNotes. when i link and join the three together i get a new table that has (and looks something like) this:
(please ignore the dashes, they are only used to preserve spacing)


CustomerID CustomerName TransactionType InvoiceValue CreditNoteValue
-----1----------John----------Invoice----------100--------------------
-----2----------Jane--------CreditNote-----------------------200------

what i was wondering is if it is possible to query the DB to get something like this:

CustomerID CustomerName TransactionType Value
----1----------John----------Invoice-------100
----2----------Jane---------CreditNote-----200

the idea is that i would like to merge the two columns (invoice & credit note together) into one Value column. since it is never possible for a TransactionType that is an Invoice to have a value in the CreditNoteValue field or a TransactionType that is a CreditNote to have a value in the InvoiceValue field, there is no possibility of a clash in the Value field (by clash i mean having values for both InvoiceValue and CreditNoteValue and not knowing which one to put in the Value field).

so, if this has made any sense to anyone, can it be done? i also understand that it may not be possible to do in one step and may require multiple sql queries or intermediate tables.

thanking you all in advance for your time. hope to hear from someone soon... Smile | :)

kind regards, Alex.



"All your base are belong to us..."

- The Nameless One (2110 A.D.)

AnswerRe: Merging multiple columns into one Pin
Paddy Boyd2-Apr-07 22:50
Paddy Boyd2-Apr-07 22:50 
AnswerRe: Merging multiple columns into one Pin
Pete O'Hanlon2-Apr-07 23:33
mvePete O'Hanlon2-Apr-07 23:33 
GeneralRe: Merging multiple columns into one Pin
Jaiprakash M Bankolli3-Apr-07 7:49
Jaiprakash M Bankolli3-Apr-07 7:49 
GeneralRe: Merging multiple columns into one Pin
Pete O'Hanlon4-Apr-07 2:47
mvePete O'Hanlon4-Apr-07 2:47 
GeneralRe: Merging multiple columns into one Pin
Frank Kerrigan5-Apr-07 3:03
Frank Kerrigan5-Apr-07 3:03 
Question.NET Pin
v s m subramanyam k2-Apr-07 21:06
v s m subramanyam k2-Apr-07 21:06 
AnswerRe: .NET Pin
Pete O'Hanlon2-Apr-07 23:30
mvePete O'Hanlon2-Apr-07 23:30 
GeneralRe: .NET Pin
Paul Conrad3-Apr-07 18:04
professionalPaul Conrad3-Apr-07 18:04 
QuestionQuery Pin
Devkranth Kishore Vanja2-Apr-07 21:05
Devkranth Kishore Vanja2-Apr-07 21:05 
AnswerRe: Query Pin
jijoaresseriljose2-Apr-07 21:44
jijoaresseriljose2-Apr-07 21:44 
GeneralRe: Query Pin
Devkranth Kishore Vanja2-Apr-07 22:14
Devkranth Kishore Vanja2-Apr-07 22:14 
AnswerRe: Query Pin
Krish - KP2-Apr-07 22:03
Krish - KP2-Apr-07 22:03 
QuestionAdding a foreign key SQL Compact edition Pin
daabs2-Apr-07 19:12
daabs2-Apr-07 19:12 
AnswerRe: Adding a foreign key SQL Compact edition Pin
daabs2-Apr-07 23:34
daabs2-Apr-07 23:34 
Questionselect data from two tables ...??? Pin
vicky4572-Apr-07 9:44
vicky4572-Apr-07 9:44 
AnswerRe: select data from two tables ...??? Pin
Krish - KP2-Apr-07 17:40
Krish - KP2-Apr-07 17:40 
GeneralRe: select data from two tables ...??? Pin
vicky4573-Apr-07 5:02
vicky4573-Apr-07 5:02 

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.