Decimal character "," or "."
Decimal character "," or "."
(OP)
Hi.
Please bear with me, as I am a complete SQL noob.
Problem is this:
I have some VBScript code that writes values to SQL tables.
The code works OK, but I found out that for REAL values, the decimal character on the PC must be set to ".". If regional settings are set to german or danish for example, the decimal character becomes ",", and the writing of the REAL values to the database fails.
I have found out how to check which decimal character is the active one on the PC, so I generate a message if its "wrong" (i.e. "Decimal character must be set to '.' in Windows Regional Settings").
Questions:
Is the decimal character always "." in SQL ?
Is the separator character always "," in SQL ?
If they are configurable, how do you set them ?
If they are configurable, how do I programmatically determine which characters are active without changing them ?
THANKS for any help.
Please bear with me, as I am a complete SQL noob.
Problem is this:
I have some VBScript code that writes values to SQL tables.
The code works OK, but I found out that for REAL values, the decimal character on the PC must be set to ".". If regional settings are set to german or danish for example, the decimal character becomes ",", and the writing of the REAL values to the database fails.
I have found out how to check which decimal character is the active one on the PC, so I generate a message if its "wrong" (i.e. "Decimal character must be set to '.' in Windows Regional Settings").
Questions:
Is the decimal character always "." in SQL ?
Is the separator character always "," in SQL ?
If they are configurable, how do you set them ?
If they are configurable, how do I programmatically determine which characters are active without changing them ?
THANKS for any help.
RE: Decimal character "," or "."
CODE
Good Luck
johnwm
________________________________________________________
To get the best from these forums read FAQ731-376: Eng-Tips.com Forum Policies before posting
Steam Engine enthusiasts
Steam Engine Prints
RE: Decimal character "," or "."
chDecPoint = Mid(CStr(8.1), 2, 1)
strVal1 = Replace(CStr(rVal1), chDecPoint, ".")
strVal2 = Replace(CStr(rVal2), chDecPoint, ".")
etc.
However, I need to know if the decimal character is ALWAYS "." in SQL.
Otherwise I may screw things up at another installation.
I have a feeling that the decimal and the separator are always "." and "," respectively.
But I would feel better if an SQL guru would confirm it for me.
RE: Decimal character "," or "."
Good Luck
johnwm
________________________________________________________
To get the best from these forums read FAQ731-376: Eng-Tips.com Forum Policies before posting
Steam Engine enthusiasts
Steam Engine Prints
RE: Decimal character "," or "."
http://
RE: Decimal character "," or "."
thanks for the info.
:)
RE: Decimal character "," or "."
Good Luck
johnwm
________________________________________________________
To get the best from these forums read FAQ731-376: Eng-Tips.com Forum Policies before posting
Steam Engine enthusiasts
Steam Engine Prints