Forum Home
Press F1
 
Thread ID: 40776 2003-12-18 00:25:00 SQL query Mike (15) Press F1
Post ID Timestamp Content User
201360 2003-12-18 08:29:00 > And you know your latitude and longitude to within
> .001 sec (2 mm), Mike? That's some precision. :D

Graham, I work in Geographic Information Systems... need I say more :p

It's actually just a plot for the centre (approx) of my house, and project from local coordinates into global lat/long. Probably a misuse of work tools, but I don't care :D

Mike.
Mike (15)
201361 2003-12-18 08:30:00 > try replacing occurances of zcoord with
>
> convert(numeric(3,1),zcoord)

It gives me an error 13 ?:| - something about "numeric" being invalid or something (I'll have to verify what it actually says tomorrow when I'm back at work).

Thanks,
Mike.
Mike (15)
201362 2003-12-18 08:33:00 > It's actually just a plot for the centre (approx) of
> my house, and project from local coordinates into
> global lat/long. Probably a misuse of work tools,
> but I don't care :D

Actually because it's taken from a transformed projection and converted into another coordinate system there's probably some projection error involved... but I decided to ignore all that, as going back the other way you'd still get the location in the local coordinate system.

Mike.
Mike (15)
201363 2003-12-18 19:47:00 I've just tried it again... I get no errors... but it doesn't display anything now for "zcoord" - it's just blank.

Mike.
Mike (15)
201364 2003-12-18 20:32:00 There's a number of things you could try, like leaving the

top line the same:

Function FindLabel ( [unittype], [zcoord], [mhdpth] )

and changing the remaining zcoords.


Another option is that the label is expecting a string, so you could chop off the decimals with the convert to numeric, and convert it back to a varchar with something like:

convert(varchar(30),(convert(numeric(10,2),zcoord) ))

You could also tinker with the numbers in numeric(X,X) to see if it works, depending on how the data looks...
Marlboro (4607)
201365 2003-12-18 20:53:00 Hi Marlboro,

Thanks heaps for your efforts! However I was told a few minutes ago that the expression needs to be vbScript, not SQL (although SQL was needed in another related part - stupid confusing program!), so I've managed to get it to work using:

FormatNumber([zcoord],2)

And it works a beaut! Next time I need something SQL I'll ask for you ;)

Cheers,
Mike.
Mike (15)
1 2