I have a table (tblCorresponde nce) holding records with fields like
[CorrespID], [VehicleJobID], [UserID], [OutType], [OutDate], [InType],
[InDate], etc...
About a dozen [OutType]'s are defined and I often use queries to
extract records of a given [OutType]. That's pretty easy.
But, recently, I wanted to list all [OutType] "15" letters, a few of
the above mentioned fields and one additional field: [OutDate] of
nother letter [OutType] "00" in the same row. That's the tough part.
It can't be simply built in the QBE grid - that much is for sure. The
[OutType] "00" correspondence record would have been created about 15
weeks earlier than the [OutType] "15" record. Listing it in the same
row is essential to my objective.
So, I'm hoping to extract a dynaset that looks something like this...
Select records where [OutType] = "15"
[CorrespID] [VehicleJobID] [UserID] [OutDate] [Type00OutDate]
159 195 17 10/15/05 7/1/05
164 200 17 10/17/05 7/3/05
168 210 17 10/22/05 7/6/05
and so on...
For each vehicle in vehicles table, there is only one correspondence
record for any given outbound letter type. This is quite difficult. I
would like to learn how this type of SQL is built. Am hoping that
someone in the NG is an SQL master and could point out some good
on-line reference material for building this kind of query. I don't
know what you call it other than a SELECT query. But it is definitely
in a different category that a simple
SELECT [CorrespID], [VehicleJobID], [OutDate], [OutType] FROM
tblCorresponden ce WHERE [OutType]="00";
[CorrespID], [VehicleJobID], [UserID], [OutType], [OutDate], [InType],
[InDate], etc...
About a dozen [OutType]'s are defined and I often use queries to
extract records of a given [OutType]. That's pretty easy.
But, recently, I wanted to list all [OutType] "15" letters, a few of
the above mentioned fields and one additional field: [OutDate] of
nother letter [OutType] "00" in the same row. That's the tough part.
It can't be simply built in the QBE grid - that much is for sure. The
[OutType] "00" correspondence record would have been created about 15
weeks earlier than the [OutType] "15" record. Listing it in the same
row is essential to my objective.
So, I'm hoping to extract a dynaset that looks something like this...
Select records where [OutType] = "15"
[CorrespID] [VehicleJobID] [UserID] [OutDate] [Type00OutDate]
159 195 17 10/15/05 7/1/05
164 200 17 10/17/05 7/3/05
168 210 17 10/22/05 7/6/05
and so on...
For each vehicle in vehicles table, there is only one correspondence
record for any given outbound letter type. This is quite difficult. I
would like to learn how this type of SQL is built. Am hoping that
someone in the NG is an SQL master and could point out some good
on-line reference material for building this kind of query. I don't
know what you call it other than a SELECT query. But it is definitely
in a different category that a simple
SELECT [CorrespID], [VehicleJobID], [OutDate], [OutType] FROM
tblCorresponden ce WHERE [OutType]="00";
Comment