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

Problems Interpreting SQL Statements !

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
I have a SELECT statement that needs to select 3
fields from a table:

Grace="SELECT Date1, Date2, 'Consumed' Status" & _
"FROM Table1 WHERE Upper(UserID)='" & UserIDGrace & "'"

1. Why will my ASP page display 'Consumed' under 1 of the
fields in the table displayed when <'Consumed' Status&quot;>
is not a field in Table1? What does <Upper(UserID)> do?
2. What are the <& _> behind <'Consumed' Status&quot;> used for?
3. Why is UserIDGrace enclosed in <'&quot; & & &quot;'>?
4. What is the 'wend' used for? is it used to end the
program?

THANX !
 
[ol][li]'Consumed' is a literal that will be displayed on each row under the heading <Status>. Upper(UserID) convert the data in the column named <UserID> to upper case.

[li]<&> is a concatenation operator, used for adding strings. <_> is a continuation character. It merely allows you to continue the script code on another line.

[li]Why is UserIDGrace enclosed in <'&quot; & & &quot;'>?
[ul][li]The double quotes (&quot;) delimit the string elements used to build the SQL statement.
[li]The single quotes (') delimit the value of UserIDGrace and indicate it is a string value.
[li]The first & concatenates the value of UserIDGrace to the string to the left of the &.
[li]The second & concatenates the string to the right to the value of UserIDGrace.[/ul]
[li]Wend marks the end of a While loop. Example:
While condition
Version [statements]
Wend[/ol] Terry
_____________________________________
Man's mind stretched to a new idea never goes back to its original dimensions. - Oliver Wendell Holmes
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top