Showing posts with label figuring. Show all posts
Showing posts with label figuring. Show all posts

Monday, March 19, 2012

Choosing decimal symbol (comma, please! :))

Hello!

I'm having a slight problem figuring out how to make a field in an Access ADP accept input using comma as decimal symbol.

The setup consists of an Access ADP connected to a SQL2000-server running on W2K(Adv). Both machines have regional settings pointing to Denmark and thus decimal symbol is ','.

When entering data through the interface made as forms in the ADP, I'm forced to enter '.' as decimal symbol for fields defined as DECIMAL(12,2) (for instance). ...This is actually a situation I could live with, if it weren't for the problems I face when trying to base calculus on these fields (doing some input checking).

Instead of resorting to making tedious code to handle the situation I know turn to you guys for help!

Regards ...and THANKS in advance! :)
Ult

NB: As an appetizer I can tell that if I multiply 1.00 with 1.00 I get 10000.00! ...So the problem is quite annoying, if you're not into opening a can of coding-with-a-distinct-feeling-of-this-is-not-quite-the-best-solution! :)http://www.dbforums.com/forumdisplay.php?forumid=84 .. post your question here|||Thanx for replying, Enigma!

I admit the problem has a touch of both worlds (Access/MSSQL) but believe/hope the problem has to do with MS SQL - all my 'pure' Access applications have none of the described problems.

I have of course not found any solution in the Access part of this forum.

U
...Still open for bright ideas! :)|||Btw, if anybody has a way to make insert-statements via Analyser accept decimals written with ',' instead of '.' it might just be part of the solution, I'm looking for!

...Or if anybody could 'kill this idea' by confirming it's not possible (at least without using 'format'-functions...)?|||The setup consists of an Access ADP connected to a SQL2000-server running on W2K(Adv).

Oops .. I missed that (Did not read the entire post :( ) !!!! Let me think about it then !!

Thursday, February 16, 2012

Checking for PK

Hi,

I want to assign a list columns to be the PK on a table. I don't know what this list of columns would be.How do I go about figuring that?

Sample Data

Col1...Col2...Col3..Col4
1.........2......A.....X
1.........2......B....X
1.........2......A.....Y

As you can see Col1 & Col2 ONLY do not make up the PK. I need to include Col3 as well. My concern is I am not sure if I have a row like..
1.........2......A.....X reapeated lower down the order. So how do I figure the PK out?

Thanksvivek...post your sample so we can cut and paste them...

btw...you have a 4 composite pk you're looking for, based on what you're asking for..

USE Northwind
GO

CREATE TABLE myTable99(Col1 int, Col2 int, Col3 char(1), Col4 char(1)
, PRIMARY KEY (Col1, Col2, Col3, Col4))
GO

INSERT INTO myTable99(Col1,Col2,Col3,Col4)
SELECT 1,2,'A','X' UNION ALL
SELECT 1,2,'B','X' UNION ALL
SELECT 1,2,'A','Y'
GO

--So Good So Far

SELECT * FROM myTable99
GO

-- Oops...No Good

INSERT INTO myTable99(Col1,Col2,Col3,Col4)
SELECT 1,2,'A','X'

DROP TABLE myTable99
GO|||I figured the solution out. I find that my entire row serves as the primary key. So now I want to compare this with a similar table having the row as the PK. I am thinking on how do I go about this right now. Any ideas are welcome.

Thanks.