Viewing 15 posts - 13,336 through 13,350 (of 13,424 total)
Something like this should do the trick:
declare @date1 datetime
set @date1 = '20050228'
select dateadd(day,-day(@date1),dateadd(month,2,@date1))
Phil
August 2, 2004 at 7:40 pm
Hi Nathan
I've had to solve this before. Try this:
WHERE LastName = IsNull(@var1,LastName) AND
IsActive = IsNull(@var2, IsActive)
Phil
August 1, 2004 at 10:38 pm
I don't think there's a really nice solution to this one. But this might work:
select t1..., t2..., t3...
from
t1 inner join t2 on t1.id = t2.id cross join...
August 1, 2004 at 10:22 pm
"... If so, make sure you create an update trigger ..." - no need. Just change the create trigger line as follows:
CREATE TRIGGER dbo.EmailINS ON Email FOR INSERT, UPDATE
Phil
July 29, 2004 at 6:02 pm
Something like this should get you most of the way:
create TRIGGER [name] ON
FOR INSERT
AS
update
set created_by = SUSER_SNAME(),
last_modified_by = SUSER_SNAME(),
date_created = GETDATE(),
date_last_modified = GETDATE()
from inserted
where
.Seqno = inserted.seqno;
create...
July 29, 2004 at 1:33 am
Hmmm - not quite sure what you're after. Do you have a 'person' table containing an e-mail field and want to maintain a separate table which contains just e-mail address...
July 29, 2004 at 1:26 am
Hi Anthony
Try using the decimal function:
Eg
select cast(14.1 as decimal(19,7)) as dp7, cast(14.1 as decimal(19,2)) as dp2
etc.
Check BOL for a full description of the function arguments.
Regards
Phil
July 28, 2004 at 10:56 pm
Hi Suhaimij
Can you post the view design here?
Regards
Phil
July 27, 2004 at 9:40 pm
Check out this recent script for ideas:
http://www.sqlservercentral.com/scripts/contributions/1141.asp
It certainly does some of what you're after.
Regards
Phil
July 27, 2004 at 8:44 pm
David
You can call the getdate() function at any time and it will return the current system datetime. It is a built-in SQL Server function and therefore does not need...
July 27, 2004 at 5:54 pm
Perhaps I should have signed myself
PhilfromEnglandbutlivinginOz
July 27, 2004 at 5:26 pm
Thanks for that! As I'm supposed to have a day job, I couldn't spend too much time wading through your stored proc - no offence
July 26, 2004 at 10:23 pm
Hi David
Can you provide sample data for cl.hours, cs.hoursperday, cs.startdate etc and also what you want to be returned in each case? As your expression is getting quite complex,...
July 26, 2004 at 6:35 pm
Haven't seen this myself, but ...
Check out this link and see whether it's of any use:
July 25, 2004 at 9:01 pm
Viewing 15 posts - 13,336 through 13,350 (of 13,424 total)