Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2005
    Posts
    313

    Unanswered: How to change variable name

    Hi:

    In SQL:

    How to change the variable name?

    For example:
    query1:
    I have a input, which is [Please enter the value 1:]

    Then,
    I want to use this query, but different values.
    I want to put [Please enter the value 2:]

    In SQL, how can I write?

    Select [Please enter the value 1:] As v1, Please enter the value 2:] As v2 from combine
    Union
    Select * from query1
    Union
    Select * from query1 where [Please enter the value 1:] = [Please enter the value 2:]

  2. #2
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    I haven't the foggiest idea what you are trying to achieve there. Remember, also, that query1 can only have two columns - ideally text.

    Anyway, looks like you are trying to use parameters:

    Code:
     
    PARAMETERS [Please enter the value 1:] Text (50), [Please enter the value 2:] Text (50), ;
    Select [Please enter the value 1:] As v1, Please enter the value 2:] As v2 from combine
    Union
    Select * from query1
    Union
    Select * from query1 where [Please enter the value 1:] = [Please enter the value 2:]
    HTH
    Testimonial:
    pootle flump
    ur codings are working excelent.

  3. #3
    Join Date
    Sep 2005
    Posts
    313
    In MS Access, how can I write?

    SQL View.

Posting Permissions

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