Data format syntax in Where Clause

For questions and postings not covered by the other forums
Nigel White
Posts: 4
Joined: Tue Apr 19, 2016 8:44 pm

Data format syntax in Where Clause

Postby Nigel White » 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?
Last edited by Nigel White on Tue Jun 07, 2016 6:48 pm, edited 1 time in total.

Nigel White
Posts: 4
Joined: Tue Apr 19, 2016 8:44 pm

Re: Data format syntax in Where Clause

Postby Nigel White » Tue May 24, 2016 2:27 pm

Is there not anyone out there that can answer this question, please?

User avatar
BeeJay
Posts: 312
Joined: Tue Jun 30, 2009 2:42 pm
Location: Christchurch, NZ

Re: Data format syntax in Where Clause

Postby BeeJay » Tue May 24, 2016 4:17 pm

Sorry, I'd help if I could but unfortunately SQL select statements into Jade is outside my area of knowledge as it's not something I've ever needed to use.

Cheers,
BeeJay.

Nigel White
Posts: 4
Joined: Tue Apr 19, 2016 8:44 pm

Re: Data format syntax in Where Clause

Postby Nigel White » Tue Jun 07, 2016 6:43 pm

Okay, we're nearly up to 300 views without any help.

I am happy for any suggestion, no matter how silly it may be.

User avatar
ghosttie
Posts: 181
Joined: Sat Aug 15, 2009 1:25 am
Location: Atlanta, GA, USA
Contact:

Re: Data format syntax in Where Clause

Postby ghosttie » Wed Jun 08, 2016 2:19 am

Some flavours of SQL have a conversion function but I don't know if JADE's ODBC driver supports it. In any case using something like that would be pretty slow, why not make sure that the data formats for the fields are the same?
I have a catapult. Give me all the money or I will fling an enormous rock at your head.

Nigel White
Posts: 4
Joined: Tue Apr 19, 2016 8:44 pm

Re: Data format syntax in Where Clause

Postby Nigel White » Wed Jun 08, 2016 2:54 am

Thanks for your reply ghosttie. I have no control over the data formats. When I bring them into any software, say MS Access for example, the formats always end up the same and I can join the tables on those fields without issue, it only seems to be during an SQL Join that they don't match, and only for some table combinations, not all. The fields are record IDs and the values are structured like '0001234.0000000123', they always end up being numeric.


Return to “General Discussion”

Who is online

Users browsing this forum: No registered users and 4 guests