Viewing 15 posts - 31 through 45 (of 105 total)
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...
December 27, 2006 at 9:54 pm
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...
December 27, 2006 at 2:29 pm
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...
December 27, 2006 at 1:33 am
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...
December 26, 2006 at 4:26 pm
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...
December 22, 2006 at 4:15 pm
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) ...
December 22, 2006 at 3:12 pm
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 =...
December 21, 2006 at 3:01 pm
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...
December 21, 2006 at 7:17 am
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...
December 21, 2006 at 6:57 am
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...
December 21, 2006 at 6:30 am
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) ...
December 20, 2006 at 5:36 pm
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...
December 19, 2006 at 6:16 am
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...
December 19, 2006 at 5:59 am
I'm pretty sure I was kidding when I posted that but it was so long ago that I forget
December 18, 2006 at 3:45 pm
I'm very interested in finding a managable solution to this.
Is there a safe (and easy) way?
December 18, 2006 at 3:20 pm
Viewing 15 posts - 31 through 45 (of 105 total)