Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Command with Outer Join

Status
Not open for further replies.

jrc1

IS-IT--Management
Apr 17, 2001
24
0
0
US
I have one table called table A and another called table B.

Table A has the following columns:
empno
chkdate
code
org1
org2
etc...

Table B is a command with the following columns:
Select DISTINCT prpost.empno, prpost.chkdate
, prpost.chknum from prpost prpost

I have a left outer join linking the table(left side) to the the commnad on empno and chkdate. I want all columns from the table and only those from the command that match. The command has a distinct clause because it has multiple lines and I only want one row returned for each emp chkdate.

It returns all rows from table A but it does NOT return the chknum from the command. The data types on empno and chkdate are the same. Any thoughts as to why I am not getting chknum would be appreciated.

Jeff

PS
Crystal version 10 using ADO to connect to foxpro dB
 
I think I found the problem but need help with a resolution. It appears there are some spaces either before or after the data. I used a trim on empno but it fails on chkdate. Below is a copy of the command:

SELECT DISTINCT trim(prhpost.empno), trim(prhpost.chkdate), prhpost.chknumber FROM prhpost prhpost

Is there anyway to clean up leading spaces on the chkdate field or convert it to a date?

Jeff
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top