Texct Wrapping in Function

  • Thread starter Thread starter JamesJ
  • Start date Start date
J

JamesJ

How would I wrap the following select statement in a funtion??
I've tried quotation marks at the end and beginning of the break with no
success.

"SELECT ReminderID, ReminderTypeIDref, ReminderDate, Reminder, ReminderTime,
ReminderNotes FROM tblReminders WHERE (((ReminderDate) Between Date() And
Date()+6) AND ((ReminderTypeIDref)<>4))ORDER BY ReminderDate, ReminderTime,
ReminderTypeIDref;"

Thanks,
James
 
Not quite sure what you're looking for.

If you're trying to return that string, it would all need to be on a single
line if you're going to put quotes at the beginning and end.

To put it on multiple lines, there are 2 basic solutions. Either add a bit
at a time, or use the continuation character:

strSQL = "SELECT ReminderID, ReminderTypeIDref, "
strSQL = strSQL & "ReminderDate, Reminder, "
strSQL = strSQL & "ReminderTime, "
strSQL = strSQL & "ReminderNotes FROM tblReminders "
strSQL = strSQL & "WHERE (((ReminderDate) Between "
strSQL = strSQL & "Date() And Date()+6) AND "
strSQL = strSQL & "((ReminderTypeIDref)<>4)) "
strSQL = strSQL & "ORDER BY ReminderDate, "
strSQL = strSQL & "ReminderTime, ReminderTypeIDref;"

or

strSQL = "SELECT ReminderID, ReminderTypeIDref, " & _
"ReminderDate, Reminder, ReminderTime, " & _
"ReminderNotes FROM tblReminders " & _
"WHERE (((ReminderDate) Between " & _
"Date() And Date()+6) AND " & _
"((ReminderTypeIDref)<>4)) " & _
"ORDER BY ReminderDate, " & _
"ReminderTime, ReminderTypeIDref;"

(note that there must be a space between the ampersand and the underscore)
 
Back
Top