Viewing 11 posts - 16 through 26 (of 26 total)
Hello,
here is a sample how to solve this
create function dbo.iptext2no(@iptext varchar(16))
returns bigint
as
begin
declare @pPosFrom int, @pPosTo int, @pWorkstring varchar(16)
set @pPosFrom = 0
set @pWorkstring = ''
while @pPosFrom < len(@iptext)+1
begin
set @pPosTo = charindex('.',@iptext,@pPosFrom)
if...
April 29, 2008 at 3:29 am
Hello,
this can be done by using the dateadd and datediff functions like this:
declare @pSampleDate smalldatetime
set @pSampleDate = CONVERT(SMALLDATETIME, '2008-01-01',120)
Select @pSampleDate, dateadd(dd,-1,
...
April 29, 2008 at 1:27 am
It depends on how you want to access to this functionality.
the base code can be like
use AdventureWorks
go
DECLARE @pYear INT, @pMonth INT
DECLARE @pDateWork SMALLDATETIME, @pDateControl SMALLDATETIME
SET @pYear = 2008
SET @pMonth...
April 29, 2008 at 1:13 am
Need this really to be done by SQL.
There are some easier ways to do this.
Like OLAP or Reporting Services or just like MTRANS Function from Excel.
April 14, 2008 at 4:09 am
I'll think you need as distint count like
DISTINCTCOUNT( [Sale[Docs].[Products].[Doc ID].Members )
I'm not sure if you need members or Currentmenbers at the end of this Statement.
W. Lengenfelder
April 14, 2008 at 3:52 am
You can try to run your statements as string with the exec statement like
if (select nDbSubVersion from tblVersion) = 113
begin
begin transaction
...
April 11, 2008 at 3:40 am
as the people posted before:
I would also avoid the use of a funktion in the From or Where Cause.
Especially in the case of the function is not scalar.
Further you should...
April 9, 2008 at 5:33 am
You can look at the execution plan. Here you can see if the SQL Server processes the Statement as same as sql 2000 does. With SQL Server 2000 i had...
April 1, 2008 at 8:00 am
Did you migrate a existing database to SQL Server 2005.
In this case you should ensure to update the database statistics.
You can do this with the stored Procedure [p][font="Courier New"]sp_updatestats[/font]
[/p]
April 1, 2008 at 1:16 am
you can also try this
[font="Courier New"]
SELECT *
FROM table_name
WHERE Created_Date BETWEEN
DATEADD(d,DATEDIFF(d,0,@varDate),0)
AND DATEADD(ms, -3,DATEADD(d,DATEDIFF(d,0,@varDate)+1,0))
[/font]
February 28, 2008 at 4:46 am
Thanks for this good Article
If you wont use time data for searching you need to cut off the time information.
The query can look like:
[font="Courier New"]WHERE PlacedOnQueue <= DateAdd(mm,-30,DateAdd(dd,DateDiff(dd,0,GetDate()),0)) [/font]
February 28, 2008 at 3:40 am
Viewing 11 posts - 16 through 26 (of 26 total)