...set nocount on
print 'Start system alert process - update_system_alerts ' + convert(varchar,getdate())
declare @myrec Cursor
/* select all user recs and their contract and visit information. Whatever is needed to check them over. */
Set @myrec = Cursor for
select
users.userid...
Sorry to bother. I answered my own question.
Use an Inner Join:
SELECT facstaff.FirstName, facstaff.LastName , Department.DivisionCode, Department.DeptCode
FROM facstaff
INNER JOIN Department ON Department.DeptCode = facstaff.Dept
WHERE Department.DivisionCode = 'NS'
ORDER BY LastName,FirstName
Assuming 3 tables:
Division (DivCode, DivName)
Department (DeptCode, DivCode, DeptName)
Professor (FName, LName, DeptCode)
How do I write a query to return a listing or professors by Division? So far I can only write queries that return Departments based on Division or Professors based on...
I have Windows XP Prof and Outlook 2000, both with any all patches available from MS. I also have Norton Antivirus 2002 Edition with LiveUpdate fully updated.
Symptoms:
1. I have noticed that whenever Outlook is invoked it pegs my CPU to 96+ percent in task manager.
2. When Outlook loads, it...
Hmmmm.
Unfortunately the list of Recipients is not a query that I can pull from a database, it is rather dependant on business rules.
But maybe I can loop through the comma delimited elements in the vTo variable. Will give it a try...
I need to send an email to multiple recipients using the JMail component. The list varies based on numerous business rules, so it is more effective to dynamically build this list of recipients and store them in one variable.
If X Then
vTo = getemail(staffid1)&"...
Perfect!!!!!
Now how does it work?
1. What is happening with the 'qt'? How is that a part of the solution?
2. What is the difference between a case expression and case statement? I must have done something wrong for you to call my attention to this point.
Thank you VERY much for your help...
...a result set without Syntax errors when I give the @CurrTab and @CheckTab fixed values. I implemented the Case Statement as follows:
SELECT *,
Case
When (SELECT Tabs.TabOrder FROM Tabs WHERE TabID=@CheckTab)<=(SELECT Tabs.TabOrder FROM Tabs WHERE TabID=@CurrTab) THEN 'Active'
When (SELECT...
...Here is my best shot
(plagued by Syntax Errors:
Incorrect syntax near the keyword 'IF'.
Line 19: Incorrect syntax near 'Active'):
SELECT *,
(
IF (SELECT Tabs.TabOrder FROM Tabs WHERE TabID=@CheckTab)<=(SELECT Tabs.TabOrder FROM Tabs WHERE TabID=@CurrTab)
BEGIN
'Active'
END
ELSE...
...I am getting a recordset that contains the field .KeepPrivate
<cfquery name="student" datasource="#request.mygordon#">
SELECT * FROM student WHERE id = '#gordon_id#'
</cfquery>
I then need to present the output to the end user based on the value of .KeepPrivate:
<cfif...
Same result: The Statements executes without error, but the results incorrectly show no results
DECLARE @ProjID int
DECLARE @ProjStatus varchar(10)
DECLARE @StartDate1 smalldatetime
DECLARE @StartDate2 smalldatetime
DECLARE @EndDate1 smalldatetime
DECLARE @EndDate2 smalldatetime
DECLARE...
The statement is executed without error, but the results are wrong:
If I search on a valid ProjectID only, there are no records in the results grid. Same thing if I search for a valid list of StatusID's.
Could this have to do with the StartDate/EndDates (which are smalldatetime)?
I am trying to integrate this solution into the full code of the stored procedure and getting an error declaring the @ProjID variable. Am I implementing the Exec() style inappropriately?:
DECLARE @ProjID int
DECLARE @ProjStatus varchar(10)
DECLARE @StartDate1 smalldatetime
DECLARE @StartDate2...
Thank you! I am now getting the correct query results.
What is the significance of the EXEC() statement? Why can't one run the SQL Statement with the string handling directly?
Yes, the StatusID is an "int".
Still getting data type error:
Server: Msg 245, Level 16, State 1, Line 1
Syntax error converting the varchar value ' + RTRIM(LTRIM(@ProjStat)) + ' to a column of data type smallint.
...to return the projects given this list of status'?
When I try to supply the list to the where clause manually, the query works.
SELECT * FROM PROJECT WHERE StatusID IN (1,3,2)
When I supply the list ot the WHERE clause via a variable, it fails with a data type error.
DECLARE @ProjStat...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.