Viewing 15 posts - 1 through 15 (of 46 total)
A EVA data model creates huge problems for those who are unwise enough to fall into the trap: No data integrity on data types, no referential integrity, no way to...
January 30, 2007 at 9:54 pm
Yes, but 1900-01-01 is not good for the code I posted, because dates earlier than 1900-01-01 would return a negative modulus.
Since there is no SQL Server datetime before 1753-01-01, there is...
January 30, 2007 at 9:35 pm
If you use PKZIP 5 or later, which has been out for 3 or 4 years, there is no limit on the size of the compressed files, and I have...
January 30, 2007 at 6:10 pm
If you do it correctly, you should be able to move the database with only a few minutes of downtime.
1. Backup the database and copy the backup to the new...
January 30, 2007 at 6:07 pm
This will give the time as an offset from midnight on 1900-1-1, the SQL Server zero day.
-- Subtract Date from Datetime to get Time on 1900-01-01 selectMyTime = MyDate-dateadd(dd,datediff(dd,0,MyDate),0) from ( Select MyDate...
January 30, 2007 at 5:51 pm
I guess I just know because it is the very first date that SQL Server supports, and I only had to look it up one time.
In any case, DATENAME(dw,'17530101') would be...
January 30, 2007 at 7:23 am
Try this function:
drop function fn_Last_Workday go create function fn_Last_Workday (@start_day datetime, @work_days int) returns datetime as begin
declare @end_day datetime declare @prior_workday datetime declare @weeks int declare @remaining_days int
-- Return null if input parameters are invalid if @start_day is null or @work_days is null or @work_days < 1 begin...
January 29, 2007 at 11:03 pm
The function you posted is a scalar function, which means it can only return a single value.
If you want it to return more than one value, it will have to...
January 29, 2007 at 9:41 pm
That is the point of the code I posted. Since it doesn't use the DATEPART function, the setting of DATEFIRST has no effect on it.
It finds the day of the week...
January 29, 2007 at 7:05 pm
I have a PC XT with a 20 MB hard drive and twin 5.25 floppy drives.
January 29, 2007 at 3:20 pm
I don't understand what the problem you are trying to solve is.
Please explain and give examples.
January 29, 2007 at 3:13 pm
The value that datepart(DW,MyDate) returns depends on the setting of datefirst.
This code will always return a value of 0 for Monday, 1 for Tuesday,..., 6 for Sunday, no matter what...
January 29, 2007 at 3:01 pm
CREATE function GetRespondentFinal( @RespondentID int, @SurveyInstanceID int) returns int as begin declare @xfinal int; set @xfinal=null;select @xfinal=max(mfinal) from ( select MAX(sie.Final) mfinal from EventLog el, surveyInstanceEvents sie where el.respondentid = @respondentid and el.eventID = sie.eventID and sie.SurveyInstanceID =...
January 29, 2007 at 2:42 pm
What is it that you want help with. Creating a table? Calculating the distance? Something else?
January 29, 2007 at 2:28 pm
This doesn't really seem to be a T-SQL question.
January 29, 2007 at 2:25 pm
Viewing 15 posts - 1 through 15 (of 46 total)