Forum Replies Created

Viewing 15 posts - 31 through 45 (of 105 total)

  • RE: checking whether a stored procedure returns anything

    If you don't mind building a temporary table whose structure covers the stored procedure's results you can do something like:

    CREATE PROCEDURE dbo.usp_MyStoredProc
    AS
    SELECT 'a' union all
    SELECT 'b' union all
    SELECT 'c' union...
  • RE: Odd SQL query isnt working

    Or since the main From clause (which is a subquery) will always be evaluated first you can insert the results into a temporary table and use that. Don't bother asking...

  • RE: Odd SQL query isnt working

    You might have simplified it too much.

    The way things look now is that you were going through hoops to make a NullIfNot function.

    For all I know, this will give you...

  • RE: Simple query question

    I don't think there is a clean way to code something like that, short of, as was suggested, using subqueries or views.

    If Access' parser...

  • RE: Table Query

    Strange.

    It seems to work on my test sample:

    declare @WeatherReport table(WeatherID int, Year smallint, Month tinyint, Day tinyint, Hour tinyint, Temp float)
    insert into @WeatherReport
    select 1, 2006, 12, 21, 1, 85 union...
  • RE: Table Query

    Select w.*
    From WeatherReport w
    Inner Join (
       Select Year, Month, Day, Temp=Min(Temp)
       From WeatherReport 
       Group By Year, Month, Day
    ) t on (w.Year=t.Year)
      ...
  • RE: Sort of recursive query problem

    You can do this:

    select
       dtl.ProductID,
       Units=Sum(dtl.qty),
       [Date]=dateadd(day, 0, datediff(day, 0, hdr.ReceiptDate)),  
       UnitsInStock=isnull(s.InStock,0)
    from PODetail dtl
    inner join POHeader hdr on hdr.PO_ID =...
  • RE: select convert(datetime,''''15/11/2006'''',101) does work

    Taken from BOL:

    "Values with the datetime data type are stored internally by Microsoft SQL Server as two 4-byte integers. The first 4 bytes store the number of days before or...

  • RE: Sort of recursive query problem

    I gathered that.

    That's the units in stock, at the present time. right?

    To trace the quantity back to the the ReceiptDate field in POHeader (could be the same product was received...

  • RE: Sort of recursive query problem

    Heh. Beat me to it by a half second. Shouldn't have pressed preview.

       ^_^

    "You said they are simplified table structures.

    Is there a Quantity field in the PODetail...

  • RE: Difficult

    That's probably meant to be a 2.

    It looks like the poster wants the equivalent of a concatenating aggregate with some form of ordering mixed in.

    when dealing with varchars, (@a+@b) ...

  • RE: Computed Columns

    No problem.

    I'm guessing you are allowing for employees who are employed twice, once as a salary and again as an hourly. Otherwise you can put a.fclass in the SELECT and...

  • RE: Computed Columns

    I guess you can always do:

    SELECT
       t.EMPNAME,
       (CASE WHEN t.Salary < 40 THEN t.Salary ELSE 40 END) As Salary,
       (CASE WHEN t.Hourly  40...
  • RE: Stripping HTML tags from data

    I'm pretty sure I was kidding when I posted that but it was so long ago that I forget

  • RE: how to restrict database users while web hosting

    I'm very interested in finding a managable solution to this.

    Is there a safe (and easy) way?

Viewing 15 posts - 31 through 45 (of 105 total)