Viewing 11 posts - 16 through 26 (of 26 total)
you've mentioned that you've solved it many ways. Can you explain how did you do that ?
March 26, 2007 at 4:43 am
check whether this works...
CREATE PROCEDURE USPCHECK_TEST (@MONTH VARCHAR(15))
AS
BEGIN
SET NOCOUNT ON
DECLARE @test-2 NUMERIC(10,2)
DECLARE @sql VARCHAR(2000)
IF OBJECT_ID('TEMPDB..##TMP') IS NOT NULL
BEGIN
TRUNCATE TABLE ##TMP
DROP TABLE ##TMP
END
SET @sql =...
September 28, 2006 at 4:07 am
y r u using the below statement ? what is the result u r expecting from the below query ??
Select @test-2 = @Month from LockDatabase where CompanyID='BM' and Finyear='2006-2007'
Will this...
September 28, 2006 at 1:02 am
Try this...
SELECT A.*
FROM CUSTOMERBRANCH A
WHERE NOT EXISTS (SELECT * FROM [SERVER].[DATABASE].DBO.TBCUSTBRANCH B WHERE A.ACCPACCODE = B.ACCPACCODE)
September 28, 2006 at 12:49 am
You can also try this...
DELETE A FROM TABLE_NAME A
WHERE CONVERT(VARCHAR(8),DATEIN,112) < CONVERT(VARCHAR(8),GETDATE(),112)
DELETE A FROM TABLE_NAME A
WHERE CONVERT(VARCHAR(8),DATEIN,112) = CONVERT(VARCHAR(8),GETDATE(),112)
AND CAST(substring(TIMEIN,1,patindex('%:%',TIMEIN)-1) AS INT) < 8
September 7, 2006 at 11:54 am
Try this...
DELETE A FROM TABLE_NAME A
WHERE CONVERT(VARCHAR(8),DATEIN,112) < CONVERT(VARCHAR(8),GETDATE(),112)
AND CAST(substring(TIMEIN,1,patindex('%:%',TIMEIN)-1) AS INT) < 8
September 6, 2006 at 9:51 pm
Will this help ?
DELETE A FROM TABLE_NAME A
WHERE CONVERT(VARCHAR(8),DATEIN,112) < CONVERT(VARCHAR(8),GETDATE(),112)
AND TIMEIN < 8
September 6, 2006 at 9:24 pm
select * into duptable from tblstudent where 1=2
September 6, 2006 at 8:04 pm
Will this help..?
SELECT COUNT(cdu_slaok) AS Total , SUM(CASE WHEN cdu_slaok = '1' THEN 1 ELSE 0 END) AS SLA_OK,
CAST(SUM(CASE WHEN cdu_slaok = '1' THEN 1 ELSE 0 END)AS DECIMAL)*100...
September 6, 2006 at 7:12 pm
Try the below query...
DECLARE @RFLAG CHAR(1)
SET @RFLAG = 'D'
IF @RFLAG = 'D'
BEGIN
SELECT COUNT(PRODUCT) NUMPOL, PRODUCT,
SUM(CAST((ORDER_TOTAL/100.00) AS DECIMAL(12,2))) TXNSALE, AGENTCODE
FROM TIS_VS
WHERE (YEAR(TXNDATETIME)=2004 OR YEAR(TXNDATETIME)=2005)
AND AGENTCODE = '12345'
GROUP BY PRODUCT, NUMPOL,...
September 6, 2006 at 3:50 pm
Hope this helps...
select Date_and_Time from <table name> where convert(varchar(8),cast(Date_and_Time as smalldatetime),112) >= '20060501'
September 5, 2006 at 9:19 pm
Viewing 11 posts - 16 through 26 (of 26 total)