For more information u click below links:
none Time Clock Table Design - Revisited - MSDN - MicrosoftSolvin g
Complex T-SQL Problems, Step-By-Step - Simple Talk
User Profile
Collapse
Profile Sidebar
Collapse
swathee
Last Activity: Dec 9 '13, 01:11 PM
Joined: Dec 3 '13
Location:
-
Try this:
@FromDate nvarchar(10),
@ToDate nvarchar(10),
WHERE (a.DateAdmitted BETWEEN ''' + @FromDate + ''' AND ''' + @ToDate + ''')';
Hope this helps.Leave a comment:
-
Code:CREATE VIEW AView AS SELECT CAST(Name AS Varchar(50)) FROM Table
Last edited by Rabbit; Dec 9 '13, 05:14 PM. Reason: Please use [CODE] and [/CODE] tags when posting code or formatted data.Leave a comment:
-
Code:WHERE CAST(Employee.[Date] AS DATE) = CAST(GETDATE() AS DATE)
Last edited by Rabbit; Dec 9 '13, 05:14 PM. Reason: Please use [CODE] and [/CODE] tags when posting code or formatted data.Leave a comment:
-
swathee replied to Find the first Day (01) and the Last Day (28) for a specified month in SQL Function?in SQL ServerCode:DECLARE @yourDate DATETIME SET @yourDate = '2013-02-17' SELECT DAY(DATEADD(MONTH, DATEDIFF(MONTH, 0, @yourDate), 0)) AS First, DAY(DATEADD(MONTH, DATEDIFF(MONTH, -1, @yourDate), -1)) AS LastLast edited by Rabbit; Dec 9 '13, 05:13 PM. Reason: Please use [CODE] and [/CODE] tags when posting code or formatted data.Leave a comment:
-
...Code:SELECT O.OrderID FROM [Order] O INNER JOIN ( -- Add up cost per order SELECT OrderID, SUM(SoldQuantity * P.SalePrice) AS Total FROM OrderLine INNER JOIN Product P ON P.ProductID = OrderLine.ProductID GROUP BY OrderID ) OL ON OL.OrderID = O.OrderID LEFT JOIN ( -- Add up total amount paid per order SELECT OrderID, SUM(CashMovementValue) AS Total FROM CashMovementLast edited by Rabbit; Dec 9 '13, 05:13 PM. Reason: Please use [CODE] and [/CODE] tags when posting code or formatted data.Leave a comment:
-
CREATE TABLE [mytable] (A CHAR(10))
INSERT INTO mytable VALUES('MARTIN' )
INSERT INTO mytable VALUES('MILLER' )
INSERT INTO mytable VALUES('TURNER' )
SELECT UPPER(SUBSTRING (A,1,3)) + LOWER(SUBSTRING (A,4,LEN(A)))
FROM mytableLeave a comment:
-
Try This:
Code:DECLARE @startDate DATETIME DECLARE @endDate DATETIME SET @startDate = DATEADD(day,-8,@enddate) SET @endDate = @FromDate ;WITH dates AS ( SELECT @startdate UNION ALL SELECT DATEADD(d,1,[Date]) FROM dates WHERE DATE < @enddate ) SELECT Date,DayName frOM datesLast edited by Rabbit; Dec 9 '13, 05:12 PM. Reason: Please use [CODE] and [/CODE] tags when posting code or formatted data.Leave a comment:
-
Code:SELECT DATEDIFF(day,'2013-10-23','2013-10-31') AS DiffDate
Last edited by Rabbit; Dec 9 '13, 05:12 PM. Reason: Please use [CODE] and [/CODE] tags when posting code or formatted data.Leave a comment:
No activity results to display
Show More
Leave a comment: