![]() | |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
i have a table name, desc, podate with name/desc character and podate a date field it is a table of vender names line descriptions and purchase order dates i need to find the last time a order was placed this is my query select name,desc from mytable group by name,desc where (select max(podate) from mystuff) i keep getting syntax errors can you help tia peter |
#3
| |||
| |||
|
|
Try this: SELECT [name], [desc], (SELECT Max(mystuff.podate) FROM mystuff WHERE mystuff.[name] = mytable.[name]) FROM mytable GROUP BY [name], [desc]; ken |
#4
| |||
| |||
|
|
Ken Snell wrote: Try this: SELECT [name], [desc], (SELECT Max(mystuff.podate) FROM mystuff WHERE mystuff.[name] = mytable.[name]) FROM mytable GROUP BY [name], [desc]; ken i am dealing with only i table called mystuff tia peter |
#5
| |||
| |||
|
|
podate is in table mystuff? Then it's easy: SELECT [name], [desc], Max(podate) FROM mystuff GROUP BY [name], [desc]; ken |
![]() |
| Thread Tools | |
| Display Modes | |
| |