Results 1 to 3 of 3

Thread: [RESOLVED] Table uses fields named SYSDATE and SYSTIME

  1. #1

    Thread Starter
    New Member
    Join Date
    May 2009
    Posts
    2

    Resolved [RESOLVED] Table uses fields named SYSDATE and SYSTIME

    I'm using VB6 to add records to an existing Progress database table which has 2 existing fields named SYSDATE and SYSTIME. Any attempt to use these names in the SQL "INSERT INTO" command causes a syntax error.

    Any ideas? Also, when I try to examine these fields with MSQUERY I get a syntax error...thanks

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Table uses fields named SYSDATE and SYSTIME

    Wrap them is brackets, although that usually applies to reserved words and I wasn't aware that those two were.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    New Member
    Join Date
    May 2009
    Posts
    2

    Re: Table uses fields named SYSDATE and SYSTIME

    Good call, the brackets didn't seem to work, but the reference to "reserved words" sent me to the MSDS site where they discussed using pairs of double quotes (") or pairs of single quotes (') around a reserved word. Neither SYSDATE nor SYSTIME were mentioned in the 100+ reserved workds for Microsoft - but perhaps they're reserved in the Progress Merant ODBC driver, so...

    I wrapped the words in double quotes ""SYSDATE"", ""SYSTIME"", and it ran and the database was updated (Crystal Reports was the only database reader that would run and show the fields without a syntax error - too bad their SQL display didn't differentiate these fields from the other fields shown, but it was useful to see if the update was successfrul).

    Once I got passed the syntax errors I got hung up on an "incorrect numeric value" error until I figured it out - so in the future if you run up against these 2 fields in your work, note that SYSTIME can be updated in seconds only.

    Thanks for all your help, Stan

Posting Permissions

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



Click Here to Expand Forum to Full Width