Viewing 15 posts - 9,256 through 9,270 (of 10,144 total)
We got there in the end! Thanks for the feedback Chris.
December 5, 2008 at 8:24 am
Have a look at the ClientID dupes in the bargains table. Are they really different clients, or do they differ in spelling, or missing country code?
Is this a one-off process,...
December 5, 2008 at 8:13 am
Did you try this:
DECLARE @Boston_prdID (numeric)
SET @Boston_prdID = 555
SELECT p.*, c.*, d.DistanceToBoston AS [MinDistanceToBoston]
FROM PRODUCTS p
INNER JOIN OTM o ON o.prdID = p.prdID
INNER JOIN CITIES c ON c.postcodeID =...
December 5, 2008 at 7:50 am
SELECT @lX = lambertX, @lY = lambertY FROM CITIES WHERE postcodeID = @localID
The definition fior the cities table doesn't include lambertX and lambertY
December 5, 2008 at 7:47 am
SELECT *
FROM dbo.Bargains
WHERE CAST(ClientID AS NVARCHAR (10)) IN (
SELECT CAST(b.ClientID AS NVARCHAR (10)) AS ClientID
FROM dbo.Bargains b
WHERE NOT EXISTS (SELECT 1 FROM dbo.tblClients c WHERE c.ClientID COLLATE...
December 5, 2008 at 7:41 am
-- Set org_id to be same org_id as manager:
UPDATE p SET org_id = m.org_id
FROM Person p
INNER JOIN Person m ON m.emp_id = p.mgr_id
December 5, 2008 at 7:31 am
Thanks...this tells us that none of the rows in the bargains table have a match in the clients table according to the matching methods we've tried.
Time to retry the INSERT...
December 5, 2008 at 7:19 am
A Little Help Please (12/5/2008)
Sorry to be Stupid, but what do you mean by"just 4 numbers"?
Nah, me stupid not you, sorry.
SELECT COUNT(*)
FROM dbo.Bargains b
--GROUP BY b.Client, b.CountryCode, CAST(b.ClientID AS...
December 5, 2008 at 7:02 am
I'm afraid your second query has a problem as well.
Now I get results where all postcodeID's are used for all products
That's the intention, sometimes a quick eyeball is all...
December 5, 2008 at 6:58 am
Hi Chris
There's an error in the JOIN, which is corrected here:
DECLARE @Boston_prdID (numeric)
SET @Boston_prdID = 555
SELECT p.*, c.*, dbo.getDistanceFromID(@Boston_prdID, c.latitude, c.longitude) AS [DistanceToBoston], d.DistanceToBoston AS [MinDistanceToBoston]
FROM PRODUCTS p
INNER JOIN...
December 5, 2008 at 6:34 am
A Little Help Please (12/5/2008)
I have now attched the...
December 5, 2008 at 6:06 am
A Little Help Please (12/5/2008)
I have now attched the...
December 5, 2008 at 6:05 am
Yep your absolutely right, this type of query is far more elegant in 2005.
Here's a query which will work.
[font="Courier New"]DECLARE @Boston_prdID (numeric)
SET @Boston_prdID = 555
SELECT p.*, c.*
FROM...
December 5, 2008 at 5:48 am
chris (12/5/2008)
Chris Morris (12/5/2008)
Say your reference city is Boston, your requirement would be:
For each and every individual product (which has been sold), list the nearest city to...
December 5, 2008 at 5:34 am
Ok lets confirm this:
Say your reference city is Boston, your requirement would be:
For each and every individual product (which has been sold), list the nearest city to Boston where it's...
December 5, 2008 at 5:26 am
Viewing 15 posts - 9,256 through 9,270 (of 10,144 total)