Viewing 15 posts - 2,431 through 2,445 (of 2,458 total)
First, by "count of" sales I assume you mean SUM of sales. Otherwise we'd be looking at a result set a little more like:
WeekEndDate SalesTotal
2011-01-07 1
2011-01-14 1
2011-01-21 1
2011-01-28 1
Lets try...
July 18, 2012 at 10:12 am
Sean Lange (7/18/2012)
See if this article helps. http://www.sqlservercentral.com/articles/T-SQL/68467/%5B/url%5D
Jeff's article is certainly a must-read on this topic.
July 18, 2012 at 8:54 am
a2zwd (7/18/2012)
I have a table which holds the running total.
DECLARE @CumCredit TABLE(RowId INT, CustomerId INT, TransId INT, Pts INT, RunningTotal INT)
INSERT INTO @CumCredit VALUES(1,123,121,10,10), (2,123,131,20,30), (3,123,141,15,45)
New resultset which needs to...
July 18, 2012 at 8:32 am
harri.reddy (7/17/2012)
hii need to add my user name into ssms,how to login first in order to add another user.
like sa or what password?
First, a little more detail would help here....
July 18, 2012 at 7:42 am
SQLSACT (7/17/2012)
How would I setup a script to copy files from a shared location on one server, to a shared location on another server?
The extension of the files would...
July 17, 2012 at 9:53 am
dndaughtery (7/17/2012)
I was told someone interviewing me would ask this. In my 7 years of DB Development Ive never had a...
July 17, 2012 at 9:19 am
-- Sample code
CREATE TABLE #T(ID INT, Unit INT)
INSERT INTO #t
SELECT 1,33 UNION ALL
SELECT 2,33 UNION ALL
SELECT 3,25 UNION ALL
SELECT 4,55 UNION ALL
SELECT 5,55
-- Query
SELECT MAX(ID) ID, MAX(Unit) Unit
FROM #t
GROUP BY...
July 16, 2012 at 7:29 am
Sean Lange (7/12/2012)
Not sure if what you posted produces what the OP wants but this...
July 12, 2012 at 10:41 am
I think this is what you are looking for.
-- Sample data
DECLARE @salesStore TABLE([CustomerID] VARCHAR(20));
DECLARE @MyTable TABLE(val varchar(20));
INSERT INTO @salesStore VALUES ('xxx'),('yyy'),('zzz');
-- Insert statement
INSERT INTO @MyTable
SELECT * FROM
(
VALUES ('Store'),('CustomerID'),('int'),('10'),('Sales'),('CustomerID'),('PK_Store_CustomerID')
)...
July 12, 2012 at 9:59 am
CELKO (7/11/2012)
SQL is an abstract model of data. We...
July 12, 2012 at 7:45 am
schleep (7/11/2012)
On one SQL server (2 instances), we get the following error on setuser.
Could not obtain information...
July 11, 2012 at 12:41 pm
sqluser_8119 (7/11/2012)
How do you make this:yyyy/mm/dd hh:mm:ss
Look like this:
mm/dd/yyyy hh:mm --hh:mm needs to be in military time
DECLARE @date datetime = '2012/06/20'
SELECT CONVERT(CHAR(10), CONVERT(datetime, @date,103),101)
July 11, 2012 at 12:18 pm
SGT_squeequal (7/11/2012)
what i want to do is...
July 11, 2012 at 9:24 am
SQLSeTTeR (7/11/2012)
Alan - Thank you very much. This did the trick.
No problem.:cool:
July 11, 2012 at 8:36 am
Sony Francis @EY (7/11/2012)
select @v-2 =case when t1.col2 like '%*%' then t2.col2 else t1.col2 end
from @table1 t1,...
July 11, 2012 at 8:35 am
Viewing 15 posts - 2,431 through 2,445 (of 2,458 total)