Viewing 15 posts - 286 through 300 (of 907 total)
all this (DATEADD(d, DATEDIFF(d, 0, hdate), 0)) does is return the value of hdate with a time of midnight (00:00:00.000). what you want to use is something like:
convert(char(10),[datetime],<style>) Look...
April 28, 2003 at 3:51 pm
If you want it for each day then you try something like this.
select userid, max([datetime]), min([datetime]) from test group by userid, convert(char(10),[datetime])
Gregory Larsen, DBA
If you looking for SQL Server Examples...
April 28, 2003 at 3:45 pm
Try something like this:
select userid, max([datetime]), min([datetime]) from test group by userid
Gregory Larsen, DBA
If you looking for SQL Server Examples check out my website at http://www.geocities.com/sqlserverexamples
April 28, 2003 at 3:42 pm
By unexpected results, do mean why is the length 8000, instead of 8001? If so, the max length of a character string in SQL Server is 8000 characters long,...
April 28, 2003 at 12:31 pm
You might try suser_sname()
Gregory Larsen, DBA
If you looking for SQL Server Examples check out my website at http://www.geocities.com/sqlserverexamples
April 28, 2003 at 11:09 am
When you issue the "EXEC" statement it executes the USE statement outside the scope of your current session. Basically it starts a new session, executes the USE statement, then...
April 25, 2003 at 3:25 pm
In reality do you really want to return all rows for every day, or do you only want to return rows for the latest day. If this is the...
April 24, 2003 at 11:02 am
If you make design changes in EM it will copy the date out, and back for you.
Gregory Larsen, DBA
If you looking for SQL Server Examples check out my website at...
April 24, 2003 at 8:10 am
You might try something like this:
SET DATEFORMAT DMY
CREATE TABLE ABC ([DATE] DATETIME, TABLENAME CHAR(10), NOOFRECORDS INT)
INSERT INTO ABC VALUES ('23-04-2003','TABLEA',10)
INSERT INTO ABC VALUES ('23-04-2003','TABLEB',50)
INSERT INTO ABC VALUES ('24-04-2003','TABLEA',15)
INSERT INTO ABC...
April 24, 2003 at 8:00 am
You might try this UDF:
This script came from: Angela But -- abut@rdns.com.au
CREATE FUNCTION fnTitleCase (@instring nvarchar(256))
RETURNS nvarchar(256)
AS
--This function will evaluate an input string and convert it to title-case format.
-- It...
April 23, 2003 at 11:28 am
Here is a good knowledge article on the subject. Of course they say use detach/attach. You can do a database backup and restore with move option as well.
http://support.microsoft.com/default.aspx?scid=kb;en-us;224071
Gregory...
April 23, 2003 at 8:05 am
Here is a function that should give you what you want. Just to give credit where credit is due, I got this script from: Angela But -- abut@rdns.com.au
CREATE FUNCTION fnTitleCase...
April 22, 2003 at 10:03 am
You might try the CASE statement and the CHARINDEX function like so:
declare @X varchar(100)
declare @Y varchar(100)
set @X = 'Testing.Test'
set @Y = 'ABCDETest Test2'
select case when charindex('.',@X) > 0
...
April 21, 2003 at 2:12 pm
Depends on what you mean by archive. SQL Server has no archive function. But you could copy the data from a table to a flat file using DTS,...
April 18, 2003 at 12:34 pm
Thank you for the reply. I'll check out these articles. Seems like moving to CDOSYS is probably the right move.
Gregory Larsen, DBA
If you looking for SQL Server Examples...
April 18, 2003 at 9:58 am
Viewing 15 posts - 286 through 300 (of 907 total)