Results 1 to 5 of 5
  1. #1
    Join Date
    Jun 2002
    Posts
    173

    Unanswered: make table query

    I have a make table query and would like to specify for each field what the data type will be. ie. number , currency, text, etc. Is there a way to do this in the query design view?
    Access97

  2. #2
    Join Date
    Oct 2001
    Location
    Chicago
    Posts
    440
    Use the Type Conversion Functions

    SELECT "123" AS TestField INTO Test;
    This creates table Test with field TestField being a Text field.

    SELECT cInt("123") AS TestField INTO Test;
    This creates table Test with field TestField being a Number field.

    -Matt

  3. #3
    Join Date
    Jun 2002
    Posts
    173
    Thanks for the help.

    This may be a really simple question but how would you specify a currency field?

    Would the,
    SELECT cInt("123") AS TestField INTO Test;
    show negative numbers and numbers with decimals as well?

  4. #4
    Join Date
    Oct 2001
    Location
    Chicago
    Posts
    440
    SELECT cCur("123") AS TestField INTO Test;

    CBool Boolean
    CByte Byte
    CCur Currency
    CDate Date
    CDbl Double
    CDec Decimal
    CInt Integer
    CLng Long
    CSng Single
    CStr String
    CVar Variant


    Matt

  5. #5
    Join Date
    Oct 2001
    Location
    Chicago
    Posts
    440
    Use CDBL for Neg/Pos with decimals

Posting Permissions

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