Stored procedure issue

Results 1 to 3 of 3

Thread: Stored procedure issue

  1. #1
    Join Date
    Dec 1969

    Default Stored procedure issue

    I have a SELECT statement (below) in a stored procedure.<BR><BR>When I run it in Access it does what it is supposed to do - return only one value for JobsAndCats.CatID for each Jobs.JobID.<BR><BR>But in the SP I&#039;m getting all the related JobsAndCats.CatID records...<BR><BR>Any ideas?<BR><BR><BR>SELECT Min(JobsAndCats.CatID), Jobs.JobID, Jobtitle, Organisation, Salary, Entrydate, Location, Closedate, Jobs.SiteID <BR>FROM categories INNER JOIN (JobsAndCats INNER JOIN Jobs ON JobsAndCats.JobID = Jobs.JobID) ON categories.CategoryID = JobsAndCats.CatID<BR>WHERE Closedate &#062;= Getdate()-1 AND Jobs.SiteID=@iSiteID <BR>GROUP BY Jobs.JobID, Jobtitle, Organisation, Categories.CategoryID, Salary, Entrydate, Location, Closedate, Jobs.SiteID <BR>ORDER BY Entrydate DESC

  2. #2
    Join Date
    Dec 1969

    Default Huh?

    You mention Stored Procedures which are for SQL Server, but then you mention Access?<BR><BR>Which is it?

  3. #3
    Join Date
    Dec 1969

    Default Well that code

    would not run in Access because of Getdate alone!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts