Viewing 15 posts - 5,551 through 5,565 (of 6,036 total)
There is NULLIF system function for your service. ![]()
See BOL for details.
February 28, 2006 at 9:47 pm
Sorry, no dynamic SQL in UDF.
But how many tables with personal details you have in your database?
If you did right design it must be only one.
If your design in...
February 28, 2006 at 9:27 pm
If you really need it this way it must be WHILE loop or a cursor.
February 28, 2006 at 6:15 pm
Select
@StartTime = convert(datetime, RecvdDate + ' ' + RecvdTime),
@EndTime = convert(datetime, ClosedDate + ' ' + ClosedTime)
SELECT @TimeSpent = datediff(n, @StartTime, @EndTime)/60.0
If you need seconds precision,
SELECT @TimeSpent = datediff(ss,...
February 28, 2006 at 5:58 pm
What do you mean "return each group as a seperate resultset"?
Return to where? And from where?
February 28, 2006 at 4:50 pm
This works:
CREATE table #tblARData (site int)
insert #tblARData values(1)
insert #tblARData values(2)
insert #tblARData values(2)
insert #tblARData values(3)
declare @tblARDataTemp table (site int)
insert @tblARDataTemp values(1)
insert @tblARDataTemp values(1)
insert @tblARDataTemp values(2)
DELETE FROM #tblARData
WHERE EXISTS (
SELECT...
February 28, 2006 at 4:48 pm
Even easier:
INSERT into tbl_hp_customers
(CustomerFirstName,CustomerSurname,TelephoneDay,TelephoneEvening,EMailAddress,OwnerID)
SELECT
SUBSTRING(Enq_CustName, 1, NULLIF(CHARINDEX(' ', Enq_CustName) - 1, -1))
SUBSTRING( Enq_CustName, CHARINDEX(' ', Enq_CustName) + 1, LEN( Enq_CustName))
, Enq_CustPhone1, Enq_CustPhone2, Enq_CustEMail, @HWID
FROM tbl_hp_enquiry
WHERE Enq_ID = @EnquiryID
AND NOT...
February 28, 2006 at 4:42 pm
IMHO, the best way to pass a table to SP or UDF is to create table #<SP(UDF)_Name>, populate it with data and use it inside of SP or UDF.
But don't forget...
February 28, 2006 at 1:27 pm
Are you sure?
What about this?
SELECT
DATE_STAMP_ "Date_Time",
CONVERT(decimal(19,4), DATA_VALUE_)) "Value"
FROM TRENDDATA AS T1
WHERE
DATA_VALUE_ = (SELECT MAX(DATA_VALUE_)
...
February 28, 2006 at 12:17 pm
You are having problem because of implicit conversions.
Declare variables for original values, assign those values and than start calculations.
Otherwise all you numbers will be implicitly converted to type real or...
February 28, 2006 at 3:58 am
Don't agree with what?
If to assign:
SET @StartDate = '2006-02-27'
SET @EndDate = '2006-02-28'
then
BETWEEN @StartDate AND @EndDate
will actually take records for 2 days, not one, if no time portions recorded...
February 28, 2006 at 3:49 am
There is an article on home page of this site.
February 27, 2006 at 8:32 pm
select
A.FacId,
max(A.PunchDT) as MaxPunchDT
from FacIds A
group by A.FacId
February 27, 2006 at 5:41 pm
Select A.Field1, A.Field2, B.Field2
FROM A
Left JOIN B on A.Field3 = B.Field1
GROUP BY A.Field1, A.Field2, B.Field2
February 27, 2006 at 4:57 pm
select ..., CASE when OwnContact = 'Y' and RevenueTotal < 40000 then 30 when OwnContact = 'Y' and RevenueTotal between 40 and 50000 then 35 Else 40 as Rate, ...
February 27, 2006 at 4:53 pm
Viewing 15 posts - 5,551 through 5,565 (of 6,036 total)