Microsoft Access query syntax help needed - need to Cast to join tables

Experts,

I have a PO_Detail table with an AutoNumber PK, data type Long Integer.

My select statement starts with Table B and I need to join table PO_Detail.

The problem is this my foreign key in table B is a Text data type instead of Long Integer.

Can someone assist and show me how to cast this Text field in column B to Long Integer and also then join the two tables on this field.

PO_Detail.AutoNumber=B.ColumnName

Thanks,
JMO9966
JMO9966Asked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
TWBitConnect With a Mentor Commented:
How about something like this:

SELECT PO_Detail.AutoNumber, PO_Detail.Desc, B.Detail
FROM B INNER JOIN PO_Detail ON clng(B.ID) = PO_Detail.AutoNumber;
0
 
TextReportCommented:
I would correct the tables if you can, it will saves loads of grief for the future.
Cheers, Andrew
0
 
JMO9966Author Commented:
Thanks TW,

I don't own the db TextReport so I'm not able to change DB properties.

JMO9966
0
All Courses

From novice to tech pro — start learning today.