R
Robert
3 Tables -Customer-Contact Index-Schedule
when I run my query
SELECT Schedule.cdDate, Schedule.StatusCode, [Contact
Index].[Contact Name], [Contact Index].ContactsType,
Customers.City, Schedule.[Schedule Lease Number],
Customers.[Company Name], Schedule.[Equipment Amount],
Customers.State, Schedule.[Fund Month]
FROM ([Contact Index] INNER JOIN Customers ON [Contact
Index].[Customer ID] = Customers.ID) INNER JOIN Schedule
ON Customers.ID = Schedule.[Customer ID]
WHERE (((Schedule.cdDate)>=(Date()-180)) AND
((Schedule.StatusCode)<>"95-WITHDRAWN" And
(Schedule.StatusCode)<>"50-TERMNATED0 CUSTOMER" And
(Schedule.StatusCode)<>"15-PENDING" And
(Schedule.StatusCode)<>"30-ON HOLD" And
(Schedule.StatusCode)<>"40-INACTIVE" And
(Schedule.StatusCode)<>"91-EXPIRED") AND (([Contact
Index].ContactsType)="Vendor" Or ([Contact
Index].ContactsType)="Broker" Or ([Contact
Index].ContactsType)="Source"))
ORDER BY Schedule.[Schedule Lease Number];
It produces a table like this(table Wraps)
* denotes column names
----First row of data----
*cdDate *StatusCode *Contact Name *ContactsType
4/30/2003 90-DECLINED Target Dis. Source
*City *Schedule Lease # *Company Name *Equipment Amount
Hendon 40446.001 Moo & Assoc. $5,857.30
*State *Fund Month
VA 9/2003
----second row of data-----
*cdDate *StatusCode *Contact Name *ContactsType
4/30/2003 90-DECLINED ICS Services Vendor
*City *Schedule Lease # *Company Name *Equipment Amount
Hendon 40446.001 Moo & Assoc. $5,857.30
*State *Fund Month
VA 9/2003
What I am looking for is to add the column "Vendor Name"
at the end of my row so that I can pull the vendors name
on any row of data that has a source. In the end I want my
table to be like this
* denotes column names
----First row of data----
*cdDate *StatusCode *Contact Name *ContactsType
4/30/2003 90-DECLINED Target Dis. Source
*City *Schedule Lease # *Company Name *Equipment Amount
Hendon 40446.001 Moo & Assoc. $5,857.30
*State *Fund Month *Vendor Name
VA 9/2003 ICS Services
----second row of data-----
*cdDate *StatusCode *Contact Name *ContactsType
4/30/2003 90-DECLINED ICS Services Vendor
*City *Schedule Lease # *Company Name *Equipment Amount
Hendon 40446.001 Moo & Assoc. $5,857.30
*State *Fund Month |*Vendor Name|
VA 9/2003 |ICS Services|
If you need more information please let me know. Thank
you for your help on this matter
Robert
when I run my query
SELECT Schedule.cdDate, Schedule.StatusCode, [Contact
Index].[Contact Name], [Contact Index].ContactsType,
Customers.City, Schedule.[Schedule Lease Number],
Customers.[Company Name], Schedule.[Equipment Amount],
Customers.State, Schedule.[Fund Month]
FROM ([Contact Index] INNER JOIN Customers ON [Contact
Index].[Customer ID] = Customers.ID) INNER JOIN Schedule
ON Customers.ID = Schedule.[Customer ID]
WHERE (((Schedule.cdDate)>=(Date()-180)) AND
((Schedule.StatusCode)<>"95-WITHDRAWN" And
(Schedule.StatusCode)<>"50-TERMNATED0 CUSTOMER" And
(Schedule.StatusCode)<>"15-PENDING" And
(Schedule.StatusCode)<>"30-ON HOLD" And
(Schedule.StatusCode)<>"40-INACTIVE" And
(Schedule.StatusCode)<>"91-EXPIRED") AND (([Contact
Index].ContactsType)="Vendor" Or ([Contact
Index].ContactsType)="Broker" Or ([Contact
Index].ContactsType)="Source"))
ORDER BY Schedule.[Schedule Lease Number];
It produces a table like this(table Wraps)
* denotes column names
----First row of data----
*cdDate *StatusCode *Contact Name *ContactsType
4/30/2003 90-DECLINED Target Dis. Source
*City *Schedule Lease # *Company Name *Equipment Amount
Hendon 40446.001 Moo & Assoc. $5,857.30
*State *Fund Month
VA 9/2003
----second row of data-----
*cdDate *StatusCode *Contact Name *ContactsType
4/30/2003 90-DECLINED ICS Services Vendor
*City *Schedule Lease # *Company Name *Equipment Amount
Hendon 40446.001 Moo & Assoc. $5,857.30
*State *Fund Month
VA 9/2003
What I am looking for is to add the column "Vendor Name"
at the end of my row so that I can pull the vendors name
on any row of data that has a source. In the end I want my
table to be like this
* denotes column names
----First row of data----
*cdDate *StatusCode *Contact Name *ContactsType
4/30/2003 90-DECLINED Target Dis. Source
*City *Schedule Lease # *Company Name *Equipment Amount
Hendon 40446.001 Moo & Assoc. $5,857.30
*State *Fund Month *Vendor Name
VA 9/2003 ICS Services
----second row of data-----
*cdDate *StatusCode *Contact Name *ContactsType
4/30/2003 90-DECLINED ICS Services Vendor
*City *Schedule Lease # *Company Name *Equipment Amount
Hendon 40446.001 Moo & Assoc. $5,857.30
*State *Fund Month |*Vendor Name|
VA 9/2003 |ICS Services|
If you need more information please let me know. Thank
you for your help on this matter
Robert