Join 2 tables using text and num fields

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • AccessHunter
    New Member
    • Nov 2007
    • 77

    #1

    Join 2 tables using text and num fields

    Hi,

    I have a query to join two tables,
    Table1 - Case (Text), Division (Text)
    Table2 - CaseID (Text), Division Num (Number)

    Please help to convert (Number to text) and join the tables in the same query.
    Please treat this as urgent.

    Load of thanks.
  • FishVal
    Recognized Expert Specialist
    • Jun 2007
    • 2656

    #2
    Originally posted by AccessHunter
    Hi,

    I have a query to join two tables,
    Table1 - Case (Text), Division (Text)
    Table2 - CaseID (Text), Division Num (Number)

    Please help to convert (Number to text) and join the tables in the same query.
    Please treat this as urgent.

    Load of thanks.
    Hi, AccessHunter.

    Try something like the following in ON clause of join.
    [code=sql]
    .... ON Val(Table1.Divi sion)=Table2.[Division Num] ...
    [/code]
    or
    [code=sql]
    .... ON Table1.Division =Str(Table2.[Division Num]) ...
    [/code]
    or use type conversion function CLng(), CStr() instead of Val() and Str()

    Regards,
    Fish

    Comment

    Working...