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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

select statement

Status
Not open for further replies.

tjm77

Programmer
Oct 2, 2000
15
US
I am running into an order by problem. I have the following select statement:

fp_sQry = "SELECT * FROM tblCMPS WHERE techID = '" & techid & "' AND year(rptMonth)=" & tYear

It works fine, except that there are two tabs on the webpage, one for 1999 and 2000, the 1999 orders by month just fine, but the 2000 data does not. any ideas on how to fix this??
 
Try to include ORDER BY Month in your query statement. Apart from that, it is always recommended NOT to use an asterisk in your SELECT statement, since this is bad for performance. If you really want to extract all the columns from your table, write them all out (SELECT month, year, TechId ... etc FROM tblCMPS.) Good luck. <webguru>iqof188</webguru>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top