Just tell me whether it is possible

Results 1 to 2 of 2

Thread: Just tell me whether it is possible

  1. #1
    Fion Guest

    Default Just tell me whether it is possible

    To have duplicate alias for displaying purpose:<BR><BR>ie: for qty1,qty2,qty3,qty4 and qty5 to appear as "Quanity" when displayed on a web page.<BR>sql = "Select o_id as ""Purchase id"",p_title as ""Project title"",justn as ""Purchase Justification""," _<BR>& "description1 as ""Item 1"",qty1 as ""Quantity"",amt1 as ""Amount""," _<BR>& "description2 as ""Item 2"",qty2 as ""Quantity"",amt2 as ""Amount""," _<BR>& "description3 as ""Item 3"",qty3 as ""Quantity"",amt3 as ""Amount""," _<BR>& "description4 as ""Item 4"",qty4 as ""Quantity"",amt4 as ""Amount""," _<BR>& "description5 as ""Item 5"",qty5 as ""Quantity"",amt5 as ""Amount""," _<BR>& "vendor1 as ""Vendor 1"", contact1 as ""Contact Person"",phone1 as ""Telephone"",fax1 as ""Fax"",address1 as ""Address""," _<BR>& "vendor2 as ""Vendor 2"", contact2 as ""Contact Person"",phone2 as ""Telephone"",fax2 as ""Fax"",address2 as ""Address""," _<BR>& "vendor3 as ""Vendor 3"", contact3 as ""Contact Person"",phone3 as ""Telephone"",fax3 as ""Fax"",address3 as ""Address""," _<BR>& "totalAmt as ""Total Amount"",date_created as ""Date Initiated"" from purchaseDetails where o_id ="&oid&""<BR>Thanks and sorry for reposting.

  2. #2
    Join Date
    Dec 1969

    Default RE: Just tell me whether it is possible

    No. You can only use <BR>&nbsp;&nbsp;&nbsp;&nbsp;... AS somename<BR>one time for each name.<BR><BR>Reason: When the result is converted to the RecordSet collection (and a RecordSet *IS* a collection, if you hadn&#039t realized that up until now), you would end up having duplicate keys, which completely screws up your ability to do<BR>&nbsp;&nbsp;&nbsp;&nbsp;someVariable = RS("Quantity")<BR><BR>But what difference does it make what the names within the RecordSet are? They don&#039t have to correspond in any way, shape, or fashion to what you end up displaying in the resultant HTML, whether via tables or any other scheme.<BR><BR>***HOWEVER***<BR>I think you have a **much** bigger problem. It is really, really obvious from your SELECT statement that you haven&#039t even *tried* to "normalize" your database. Unnormalized databases make queries, data integrity checks, data constraint tests, and a whole raft of other Relational Database capabilities much, much tougher to implement. <BR><BR>You need to go read a good book on database design. Or at least read a couple of Web pages on "normalization". And then redesign your tables from the bottom up.<BR><BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts