Converting a field from int to varchar during query

From: Jig Bhakta (JigBhakta_at_discussions.microsoft.com)
Date: 02/02/05


Date: Wed, 2 Feb 2005 13:07:04 -0800

I have a query where I am writing the following statement:

select * from ......
where table1.field1 = table2.field2
....
....
....

field2 is a varchar field and field1 is an int field. Field2 contains the
data mapping data for field1 and also other unrelated data as character
strings.

How do I run this query without getting the error - "Syntax error converting
the varchar value 'XXXX' to a column of data type int."

Thanks,

Jignesh.



Relevant Pages

  • Re: Combo-Box list unsorting
    ... RecordSource property and select it. ... it'll take you to the query. ... drag-dropping fields from Table1 to the Form. ... want one of the fields (say Field2) in Table1 and the Form. ...
    (microsoft.public.access.gettingstarted)
  • Re: [PHP] Mysql strategy
    ... > If I have to perform 30 LIKE searches for different keywords in a ... > 2) To select the varchar field from all the rows, ... If you are worried about the speed of this query I'd suggest rethinking ... your database structure. ...
    (php.general)
  • Re: Combo-Box list unsorting
    ... I am still in the process of creating my database. ... However, in the form Field option, I still see Field2 (ex. ... query as the RowSource for the combo box rather than just the table. ... Source a field I (called visitType) in a table called visits. ...
    (microsoft.public.access.gettingstarted)
  • Re: need to delete record having two different fields with same identical value
    ... Assuming you're always comparing the same two fields (Field1 and Field2) ... Run the query to check it, and then turn it into a delete query. ... which might be a lot safer (I hate deleting data unless I ...
    (microsoft.public.access.gettingstarted)
  • Re: Using flexible query criteria
    ... criteria for the query is based on the user's input in the main form. ... One of the user inputs is a field called "Vendor_Name" (in the form of ... and said that Field1 is the primary key and is an autonumber field, and Field2 is the field shown in the combo box, you must modify it to a UNION select, similar to ...
    (comp.databases.ms-access)