Data format syntax in Where Clause
Posted: Tue Apr 19, 2016 11:31 pm
I have the following SQL query to extract data from a Jade database using ODCB.
SELECT
Table1.Field1,
Table1.Field2,
Table1.Field3,
Table1.Field4,
Table2.Field5
FROM Table1, Table2
Where Table1.Field6 = Table2.Field7;
It returns zero rows even though there is data in both tables and Field6 and Field7 have matching values in both Tables. I suspect that the data format of Field6 is different to Field7, so I understand that I need to convert the format in the Where clause, however, I am unsure of the syntax. I think Field6 is being evaluated as a number and Field7 is being evaluated as a string. What syntax do I use to convert them both to a number or both to a string, please?
SELECT
Table1.Field1,
Table1.Field2,
Table1.Field3,
Table1.Field4,
Table2.Field5
FROM Table1, Table2
Where Table1.Field6 = Table2.Field7;
It returns zero rows even though there is data in both tables and Field6 and Field7 have matching values in both Tables. I suspect that the data format of Field6 is different to Field7, so I understand that I need to convert the format in the Where clause, however, I am unsure of the syntax. I think Field6 is being evaluated as a number and Field7 is being evaluated as a string. What syntax do I use to convert them both to a number or both to a string, please?