Sorting in a SQL statement

G

Guest

I'm sure this is something I SHOULD KNOW - but for the life of me I can't
figure it out right now! UGH!

Can anyone help me sort this sql statement? I need to sort the table by the
EDLIEntryID but I am unsure of the syntax.

strSQL = "SELECT EntryDetailLineItem.* FROM EntryDetailLineItem WHERE
EntryDetailLineItem.EDLIEntryID = " & Me.EDLIEntryID

Thanks for any help given!!!!!

Janis in Minne-SNOW-ta (and freezing my butt off as well!!!!)
 
D

Duane Hookom

strSQL = "SELECT EntryDetailLineItem.* " & _
"FROM EntryDetailLineItem " & _
"WHERE EntryDetailLineItem.EDLIEntryID = " & Me.EDLIEntryID & _
" ORDER BY EDLIEntryID"
 
C

Crystal

Hi Janis,

BASIC SQL SYNTAX

SELECT fieldlist
FROM tablename
IN anotherdatabase.mdb
WHERE conditions
GROUP BY fieldlist
HAVING conditions for fields that are grouped
ORDER BY fieldlist;


Have an awesome day

Warm Regards,
Crystal

MVP Microsoft Access
(e-mail address removed)
 
G

Guest

Thank you VERY much!!!!!!!

Janis

Duane Hookom said:
strSQL = "SELECT EntryDetailLineItem.* " & _
"FROM EntryDetailLineItem " & _
"WHERE EntryDetailLineItem.EDLIEntryID = " & Me.EDLIEntryID & _
" ORDER BY EDLIEntryID"

--
Duane Hookom
MS Access MVP
about 75 miles east in Wisconsinfully Cold
However it's about time we got some snow!
 
T

Tim Ferguson

=?Utf-8?B?SmFuaXMgaW4gTWlubmVzb3Rh?=
strSQL = "SELECT * " & _
"FROM EntryDetailLineItem " &
"WHERE EDLIEntryID = " & Me.EDLIEntryID


Since there is only going to be one EDLIEntryID value, why bother to sort
on it? Wouldn't it be better to sort on something else?

Just a thought


Tim F
 
G

Guest

Yes - I am going to be sorting by an invoice number - but just needed the
syntax to do this sort! I didn't want my sql statement to be soo long - just
wanted to get my point across.
Thanks again!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top