Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Fix Join strings to get correct records
Message
De
14/09/2007 17:46:33
 
 
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Versions des environnements
SQL Server:
SQL Server 2005
Divers
Thread ID:
01254404
Message ID:
01254473
Vues:
11
there can be 6 records for morning and 6 records for afternoon, any others are ignored.

>How many records could be in each group?
>
>>
>> This query is suppose to combine another table into a wide table. From my questions before about getting records from going down to going across:
>>
>>id    timefield         field1  field2  field3   field4
>>1      01/01/00 15:45    hi      0       check   field
>>1      01/01/00 7:48     bye     1       double  main
>>2      01/01/00 14:51    hi      0       check   field
>>2      01/01/00 8:48     bye     1       NULL    main
>>3      NULL              get     0       fake    NULL
>>3      NULL              get2    1       fake    NULL
>>4      01/01/00 16:05    get1    1       fake    NULL
>>
>>need to get into this form:
>>
>>id  amtime     amfield1   amfield2 amfield3  amfield4  am1time  am1field1  am1field2 am1field3 am1field4 pmtime  pmfield1 pmfield2 pmfield3 pmfield4 pm1time pm1field1 pm1field2 pm1field3 pm1field4
>>1  7:48AM      hi          0        check    field                                                       3:45PM  bye        1      double   main
>>2  8:48AM      hi          0        check    field                                                       2:51PM  bye        1               main
>>3              get         0        fake                                                                         get2       1      fake
>>4                                                                                                        4:05PM     get1       1      fake
>>
>>field2 is the TripAsgn_PickUp and id is the stutrip_stu_autoid. id identifies the records to group together, while field2 says if they are am or pm and timefield is the order within the am or pm.
>>
>>Hope this makes more sense. I am still figuring this whole thing out.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform