TableA
Date Dept
1/2/09 Order
1/10/09 Build
2/10/09 Ship
Invoice
I have a "TableA" which includes these two columns. I would like to display on my Crystal Reports the latest department on the order. I've looked at using SQL expression, but it error out may be because I'm hitting against an Oracle DB? It seems very easily doable, but so hard.
select Dept, Date
from TableA
where (Date = (select max(Date) from TableA where sonum = xxxxxx1 and soitemnum = 1))
and sonum = xxxxxx1
and soitemnum = 1
This SQL statement gives me exactly what I want to see, but can't seem to translate it to work with Crystal XI.
The result I'd like to see here would be
2/10/09 Ship
Date Dept
1/2/09 Order
1/10/09 Build
2/10/09 Ship
Invoice
I have a "TableA" which includes these two columns. I would like to display on my Crystal Reports the latest department on the order. I've looked at using SQL expression, but it error out may be because I'm hitting against an Oracle DB? It seems very easily doable, but so hard.
select Dept, Date
from TableA
where (Date = (select max(Date) from TableA where sonum = xxxxxx1 and soitemnum = 1))
and sonum = xxxxxx1
and soitemnum = 1
This SQL statement gives me exactly what I want to see, but can't seem to translate it to work with Crystal XI.
The result I'd like to see here would be
2/10/09 Ship