Showing posts with label locale. Show all posts
Showing posts with label locale. Show all posts

Tuesday, March 20, 2012

Problem with format of DateTime parameter

I am in Australia.
Our machines have an Australian/English locale which as a date order of
Day/Month/Year.
I am using SQL RS 2005.
When I add a parameter of type DateTime and then preview the report a
strange thing happens.
* Use an Australian machine locale
* Create a dataset with no SQL. The dataset is just
SELECT @.MyDateParm
* Create a simple layout that uses this dataset
* Preview the report. You should get the nice date selection dialog.
* Select 1st December 2005
* View the report - It switches magically to 12th January 2005
* View again - it switches back etc..
Now what is going on here?
(Professor Julius Sumner Miller)
(I know my likely solution is to move to the USA - or at least change
my locale :)Has anyone ever encountered this problem?
I think it is a bug in RS2005.
Does anyone know how I could report this?
Thanks
RBot wrote:
> I am in Australia.
> Our machines have an Australian/English locale which as a date order of
> Day/Month/Year.
> I am using SQL RS 2005.
> When I add a parameter of type DateTime and then preview the report a
> strange thing happens.
> * Use an Australian machine locale
> * Create a dataset with no SQL. The dataset is just
> SELECT @.MyDateParm
> * Create a simple layout that uses this dataset
> * Preview the report. You should get the nice date selection dialog.
> * Select 1st December 2005
> * View the report - It switches magically to 12th January 2005
> * View again - it switches back etc..
> Now what is going on here?
> (Professor Julius Sumner Miller)
> (I know my likely solution is to move to the USA - or at least change
> my locale :)|||Well there are other people having problems with Date type parameters:
http://www.sqlservercentral.com/forums/shwmessage.aspx?forumid=150&messageid=286639
but where should I report this so it can be fixed?

Saturday, February 25, 2012

Problem with decimal point

I have got txt file and I am trying to import this file into the database. For that action I use SQL Server Import and Export Wizard. I use Locale Czech and CodePage 1250. In the text file is the column in that format: 18152.65 - it is number with decimal point. When I use BCP utility for importing data, I use datatype decimal(10,2) and everything is OK. But when I try to use Import and Export Wizard, I choose for that column datatype numeric (DT_NUMERIC - precision 10, scale 2), the Import doesn't start and occurs the error:

- Executing (Error)

Messages

Error 0xc02020a1: Data Flow Task: Data conversion failed. The data conversion for column "PRED_CEL " returned status value 2 and status text "The value could not be converted because of a potential loss of data.".
(SQL Server Import and Export Wizard)

Is it always a precision of 10, and a scale of 2? You may have some inconsistent data. There's two things you could do.

1) Increase the precision and scale.

or

2) Create a custom SSIS package, and redirect the error rows to see where the data inconsistency is. The Import/Export Wizard is great for straight forward tasks, but you'll find that with the smallest blib you'll need to create a custom package.

|||The import is very picky about number formats when importing from flat files. It will NOT import zero padded numbers into a decimal field. Even though it will implicetly convert it internally.

For example:
3.99 - OK
003.99 - FAILS
+003.99 - OK
-003.00 - OK

If you import "003.99" into a varchar(12) and then update a decimal(10,2), with the value of teh varchar, it will work fine.