Hi All,
I have a table (mytable) that has the following columns:
ID EnhanceID Comment
ID is a numeric primary key
EnhanceID is numeric
Comment is text
I have a simple report ('myreport') that returns all of the comments for an 'EnhanceID' and the corresponding 'ID' value (each 'EnhanceID' may have many comments associated with it, each comment is uniquely identified by 'ID').
I'd like a sql query that returns the comment associated with the maximum value of 'ID' for a particular EnhanceID.
I'd like to get the value of 'EnhanceID' from text100 (a text box) on 'myreport'
I have tried in query design view, but can't build what I am after. My sql knowledge falls short as I don't know how to correctly state:
Select 'comment' from 'mytable' where 'EnhanceID' = 'myreport.text100' AND mytable.ID=MAX(ID).
Any help greatly appreciated.
Regards
Dan
I have a table (mytable) that has the following columns:
ID EnhanceID Comment
ID is a numeric primary key
EnhanceID is numeric
Comment is text
I have a simple report ('myreport') that returns all of the comments for an 'EnhanceID' and the corresponding 'ID' value (each 'EnhanceID' may have many comments associated with it, each comment is uniquely identified by 'ID').
I'd like a sql query that returns the comment associated with the maximum value of 'ID' for a particular EnhanceID.
I'd like to get the value of 'EnhanceID' from text100 (a text box) on 'myreport'
I have tried in query design view, but can't build what I am after. My sql knowledge falls short as I don't know how to correctly state:
Select 'comment' from 'mytable' where 'EnhanceID' = 'myreport.text100' AND mytable.ID=MAX(ID).
Any help greatly appreciated.
Regards
Dan