Viewing 15 posts - 2,146 through 2,160 (of 2,169 total)
Try calling API
ExpandEnvironmentVariable
May 23, 2006 at 1:42 pm
To connect to Excel, one can use OleDb objects that will treat Excel as a database, and then the required information can be easily fetched...
May 22, 2006 at 12:34 am
Hi Joe!
I have read your books on SQL for smarties over and over again! Never thought I met you online.
Sorry to say there is a glitch in your query.
Suppose...
May 19, 2006 at 2:21 pm
I run the queries against a test set of 10 000 rows of DATETIME and INT and they tooks...
May 19, 2006 at 2:07 pm
DECLARE @FromDate DATETIME,
@ToDate DATETIME,
@DateRange INT,
@SKU VARCHAR(1)
May 19, 2006 at 8:35 am
Should the range be as followed?
01-01-2006..............A.........20
01-01-2006..............B.........20
02-01-2006..............A.........30
02-01-2006..............A.........40
02-01-2006..............B.........10
04-01-2006..............A.........20
04-01-2006..............A.........50
05-01-2006..............A.........40
05-01-2006..............A.........10
Now suppose my daterange is 2 days, so in the above table i need to get the total for :
01-01-2006 - 02-01-2006 (2days) Sum for...
May 19, 2006 at 8:23 am
Here we go again...
DECLARE @FromDate DATETIME,
@ToDate DATETIME,
@DateRange INT,
@SKU VARCHAR(1)
SELECT @FromDate = '2004-01-15',-- This is the starting date in the range
@ToDate...
May 19, 2006 at 8:18 am
The data is not stored as a date range. See example.
"I have a table with the following data (date, value)"
May 19, 2006 at 8:14 am
Or more specific
DECLARE @FromDate DATETIME,
@ToDate DATETIME,
@DateRange INT
SELECT @FromDate = '2004-01-15',-- This is the starting date in the range
@ToDate = '2008-02-20',-- This...
May 19, 2006 at 8:12 am
You mean like this?
DECLARE @FromDate DATETIME,
@ToDate DATETIME,
@DateRange INT
SELECT @FromDate = '2004-01-15',
@ToDate = '2008-02-20',
@DateRange = 20
SELECT MIN(Date)...
May 19, 2006 at 8:10 am
The greatest factor is proper indexes.
I run the two questions against our production server with 90+ million rows.
DISTINCT took 66 seconds.
GROUP BY took 8 seconds.
May 19, 2006 at 3:28 am
Based on the original posting, the query would be someting like
SELECT AggregateGroup, 1 FiscalMonth, Jan Amount FROM MySourceTable
UNION ALL
SELECT AggregateGroup, 2, Feb FROM MySourceTable
UNION ALL
SELECT AggregateGroup, 3, Mar FROM MySourceTable
UNION ALL
SELECT AggregateGroup, 4, Apr FROM MySourceTable
UNION...
May 18, 2006 at 1:28 pm
Here is the real query with some optimization techniques...
SELECT SUM(CASE WHEN DT.type = 'r' THEN DT.Items ELSE 0 END) Registrations,
SUM(CASE WHEN DT.type = 'c' THEN DT.Items ELSE 0...
May 18, 2006 at 12:18 pm
Heureka! I've found it!
Here is a "one query"-solution...
SELECT DISTINCT CONVERT(SMALLMONEY, x1 + ((x4 - x3) * (y1 - y3) - (y4 - y3) * (x1 - x3)) * (x2...
May 18, 2006 at 8:51 am
The result of your supplied geodata is:
(27.9272; -26.1670)
(27.9290; -26.1677)
(27.9291; -26.1677)
(27.9292; -26.1678)
(27.9293; -26.1678)
(27.9300; -26.1673)
There are six intersections within the supplied geodata.
May 18, 2006 at 6:38 am
Viewing 15 posts - 2,146 through 2,160 (of 2,169 total)