Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_database_setup thread: Re: asp_database_setup digest


Message #1 by "Mail List Management Account" <lists@m...> on Sat, 05 May 2001 02:33:23 -0400
Thank you Ken for the reply, but I am still receiving the data type 

mismatch error.  The SYOR variable is a number.  Typically I deal with my 

numbers in lists by ending the sql statement and appending a [&cint

(syor), connection, blah blah blah] to the end of my command.  This 

always works, but up to this point I have not had to sort by the ending 

number (the value of syor.)  If you have any ideas I am all ears.  



And thank you one more time for the excellent link to the sql tutorial.  

I truly appreciate your help.  I will be spending some time reviewing the 

tutorial.



Regards,



Bill Sisemore



> 

> Any help is appreciated.

> 

> Below is the code I am using to extract some records.  It works fine

> with 

> the exception of th SYOR variable, which is a number (2001 in this

> case.)

> 

> *****

> pq.open "select * from logon where fn='" & fn & "' and mor='" & smor &

> "' 

> and yor='" & syor & "' order by value and mor and yor desc"

> ****

> 

> I am getting the ever-popular datatype mismatch error.

> 

> My problem is that I cannot figure our how to use the ORDER BY clause 

> with the cint(syor) variable at the end of the sql statement.  For 

> example,

> 

> ****

> pq.open "select * from logon where fn='" & fn & '" and mor-'" & smor &

> "' 

> and yor=" &cint(syor) ------ Does anyone know what I need to put here

> or 

> change in the example above to make the ORDER BY statement work?

> ****

> 

> Thanks in advance...

> 

> Bill S.

> 

> 

> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

> 

> You are using ORDER BY incorrect:

> 

> SELECT *

> FROM Logon

> WHERE

>     fn = 'fn'

> AND

>     mor = 'smor'

> AND

>     yor = 'syor'

> ORDER BY Value ASC, Mor ASC, Yor DESC

> 

> will work

> SQL tutorial here:

> http://w3.one.net/~jhoffman/sqltut.htm

> 

> Cheers

> Ken

> 

> 

  Return to Index