Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
crtdude
Starting Member
13 Posts |
Posted - 2010-03-15 : 08:35:32
|
| I am having a bit of an issue trying to get the correct select statement in the code below and was hopeful one of the experts in this forum would be gracious enough to assist.This is a snippet within a calendar based event display utility. A form page displays a pull-down for a month/year selection from the user. As originally constructed, it was only for use in one property location but we now have several. I wanted to be able to select by month/year for a specific property, so I added a column to the database named property and now need to add in an additional variable so I can get the correct events for a specific month for a specific property.Any help would be greatly appreciated.=========='******** get event data ********If GetRequest("user_admin") = "" ThenobjCommand.CommandText = "select * from OMNINEEDTEST where" &_" NDATE_MONTH in (0," & Month(objDate) & ")" &_" and NDATE_YEAR in (0," & Year(objDate) & ")" &_" order by NDATE_DAY"Set objRS = objCommand.ExecuteIf GetRequest("view") = "yes" And GetRequest("admin_action") = "" ThenobjCommand.CommandText = "select * from OMNINEEDTEST where" &_" NDATE_MONTH in (0," & Month(GetRequest("date")) & ")" &_" and NDATE_DAY = " & Day(GetRequest("date")) &_" and NDATE_YEAR in (0," & Year(GetRequest("date")) & ")" &_" or event_weekday = " & WeekDay(GetRequest("date")) &_" or RecordID = " & GetRequest("RecordID")Set objRS_view = objCommand.ExecuteElseIf GetRequest("view") = "yes" And GetRequest("admin_action") = "edit" ThenobjCommand.CommandText = "select * from OMNINEEDTEST where" &_" RecordID = " & GetRequest("RecordID")Set objRS_view = objCommand.ExecuteEnd IfEnd If========== |
|
|
Lamprey
Master Smack Fu Yak Hacker
4614 Posts |
|
|
|
|
|