Results 1 to 3 of 3
  1. #1
    5 Star Lounger bfxtrfcmgr's Avatar
    Join Date
    Aug 2002
    Location
    Fresno, California, USA
    Posts
    995
    Thanks
    12
    Thanked 0 Times in 0 Posts

    Format Table 'caption' in SQL (2002 SP-2)

    Sorry for the "subject" title, really couldn't think of how to put this.
    I'm trying to sync a table from my Access db into my Pocket PC. I have a make-table query to extract the info I want to the Pocket PC software (it will only accept a table; not forms, queries, etc). The problem I'm having is that the table column "headings" are, of course, the field names of the original table behind the make-table query. Having been so prudent as to use appropriate naming conventions, my Pocket PC is displaying "dtmShConDate2" for 05/19/04, so even as much as the name makes little "english" sense, its even worse that it's longer than the data (the whole "header" isn't even in view).

    My thought is, seeing as how the Pocket PC uses SQL to display the table data, that there might be some top-secret way of writing the "header" caption into the SQL (like you re-name a caption in the field properties of a query). Here is the current SQL from the make-table query (in the Access db), any ideas?

    <pre>SELECT [qfltLoadHistoryThis/NextWeek].ProNo,
    [qfltLoadHistoryThis/NextWeek].txtRelease1No,
    [qfltLoadHistoryThis/NextWeek].txtOrderedByCSR,
    [qfltLoadHistoryThis/NextWeek].txtCustomerNo,
    [qfltLoadHistoryThis/NextWeek].txtOrderStatus,
    [qfltLoadHistoryThis/NextWeek].txtShipperConsignee1,
    [qfltLoadHistoryThis/NextWeek].txtShConCity1,
    [qfltLoadHistoryThis/NextWeek].dtmShConDate1,
    [qfltLoadHistoryThis/NextWeek].txtShipperConsignee2,
    [qfltLoadHistoryThis/NextWeek].txtShConCity2,
    [qfltLoadHistoryThis/NextWeek].dtmShConDate2,
    [qfltLoadHistoryThis/NextWeek].dtmShConFromTime2,
    [qfltLoadHistoryThis/NextWeek].dtmShConToTime2,
    [qfltLoadHistoryThis/NextWeek].dtmShConApptTime2
    INTO tblCarrierSchedule FROM [qfltLoadHistoryThis/NextWeek]
    WHERE ((([qfltLoadHistoryThis/NextWeek].txtOrderStatus)
    <>"CANCELLED"
    And ([qfltLoadHistoryThis/NextWeek].txtOrderStatus)
    <>"VOID"))
    ORDER BY [qfltLoadHistoryThis/NextWeek].dtmShConDate1,
    [qfltLoadHistoryThis/NextWeek].ProNo;
    </pre>

    Bryan,
    Not the smartest critter on the glacier. . .
    . . .but I'm persistent (does that count?)

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Format Table 'caption' in SQL (2002 SP-2)

    You can define an "alias" for a field by putting "As ..." after the field:

    SELECT ...
    ...
    [qfltLoadHistoryThis/NextWeek].dtmShConDate2 As Date2
    ...

    You can do the same in design view of a query in Access by putting the alias and a colon before the field name:

    Date2: dtmShConDate2

  3. #3
    5 Star Lounger bfxtrfcmgr's Avatar
    Join Date
    Aug 2002
    Location
    Fresno, California, USA
    Posts
    995
    Thanks
    12
    Thanked 0 Times in 0 Posts

    Re: Format Table 'caption' in SQL (2002 SP-2)

    <font color=blue>Beautiful!!</font color=blue> <img src=/S/clapping.gif border=0 alt=clapping width=19 height=23>
    Now I wonder why I was giving myself so much grief working the SQL in the Pocket PC, when all I really needed to do was set it all up in the make-table query and sync the table as a finished product!
    <img src=/S/beep.gif border=0 alt=beep width=15 height=15>
    <img src=/S/thankyou.gif border=0 alt=thankyou width=40 height=15>
    Bryan,
    Not the smartest critter on the glacier. . .
    . . .but I'm persistent (does that count?)

Posting Permissions

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