Viewing 15 posts - 2,611 through 2,625 (of 3,011 total)
I find that the dateadd/datediff method is the most convenient way to code for these sorts for problems. Once you understand what it is doing, it is very intuitive...
January 2, 2008 at 10:24 am
This should do what you want.
SELECT
*,
DateRecorded AS Expr1
FROM
tbl_ISALOG_SingleUser
WHERE
DateRecorded < dateadd(day,datediff(day,0,getdate())-3,0)
January 2, 2008 at 10:04 am
Phil Factor (12/31/2007)
December 31, 2007 at 10:24 am
karthikeyan (12/31/2007)
Michael,select FirstOfThisMonth =dateadd(month,datediff(month,0,getdate()),0),LastOfThisMonth =dateadd(month,datediff(month,-1,getdate()),-1),FirstOfLastMonth =dateadd(month,datediff(month,0,getdate())-1,0),LastOfLastMonth =dateadd(month,datediff(month,-1,getdate())-1,-1)
Thanks.only the first two was worked.
I have made some changes in the last 2 statements.
FirstOfLastMonth =dateadd(month,datediff(month,0,dateadd(mm,-1,getdate())),0),
LastOfLastMonth =dateadd(month,datediff(month,-1,dateadd(mm,-1,getdate()),-1)
It gave last month's firstdate & lastdate.
You must...
December 31, 2007 at 10:05 am
You can use the function on this link to generate up to 16,777,216 rows at a time for any valid datatype integer range.
I recommend that you do not insert more...
December 31, 2007 at 8:39 am
I would recommend that you do transaction log backups much more often; every 15 minutes 24x7 is a good starting point. If your transaction volume is really high, you...
December 28, 2007 at 8:57 am
You can use a default value like this:
datename(month,getdate())+' '+
convert(varchar(2),day(getdate()))+', '+
convert(varchar(4),year(getdate()))
December 26, 2007 at 11:59 am
This will do it.
select
FirstOfThisMonth =
dateadd(month,datediff(month,0,getdate()),0),
LastOfThisMonth =
dateadd(month,datediff(month,-1,getdate()),-1),
FirstOfLastMonth =
dateadd(month,datediff(month,0,getdate())-1,0),
LastOfLastMonth =
dateadd(month,datediff(month,-1,getdate())-1,-1),
FirstOfNextMonth =
dateadd(month,datediff(month,0,getdate())+1,0),
LastOfNextMonth =
dateadd(month,datediff(month,-1,getdate())+1,-1)
Start of Time Period Functions:
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=64755
Start of Week Function:
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=47307
End Date of Time Period Functions:
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=64759
End of Week Function:
December 24, 2007 at 10:44 am
You should read about collations in SQL Server Books Online.
December 14, 2007 at 12:30 pm
Set the collation of the PK column to a case sensitive collation.
December 14, 2007 at 11:33 am
This script gives you a number of ways to analyze space usage on a server:
File Details
Total by Database and File
Total by Database and Filegroup
Total by Database and Filegroup Type
Total by...
December 14, 2007 at 9:46 am
You can only shrink a database file if it has free space. The script below will give you that information.
Get Server Database File Information
December 14, 2007 at 8:55 am
This works on 7.0, 2000, and 2005
Get Server Database File Information
December 11, 2007 at 10:08 am
Carla Wilson (12/11/2007)
December 11, 2007 at 8:54 am
Barry McConnell (12/11/2007)
December 11, 2007 at 8:45 am
Viewing 15 posts - 2,611 through 2,625 (of 3,011 total)