Charlotte Foust
cfoust at infostatsystems.com
Tue Oct 14 18:52:19 CDT 2008
You may have trouble if the machines use different regional settings and currency is saved in the regional format. Some currency settings use a comma for the decimal delimiter and either a period or a space for the grouping delimiter. Charlotte Foust -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Andy Lacey Sent: Tuesday, October 14, 2008 2:52 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] CSV and currency symbols I agree. I was just being lazy and wondering if anyone had written the code, save me reinventing the wheel. Never mind, I'll just do it. Andy Lacey -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: 14 October 2008 20:39 To: accessd at databaseadvisors.com Subject: Re: [AccessD] CSV and currency symbols Hi Andy Then you'll have to create some kind of profile for each source to define how to handle the import. The easiest method is to read each record into a string array and then - using the current profile - convert this to an interim format which you then can have a common routine to pass to your database table(s). /gustav >>> andy at minstersystems.co.uk 14-10-2008 18:03 >>> Hi Gustav, thanks as always for your input The CSV files are coming from a variety of systems. They are finacial reports from accounting systems at multiple sites, and different sites have different accounting systems. They're also packages so the sites generating the reports have limited flexibility. They can choose the package's "Output to CSV" option but generally not much more. So I have to handle this in my Access stuff that is going to receive the data and analyse it. Andy Lacey http://www.minstersystems.co.uk --------- Original Message -------- From: "Access Developers discussion and problem solving" <accessd at databaseadvisors.com> To: "accessd at databaseadvisors.com" <accessd at databaseadvisors.com> Subject: Re: [AccessD] CSV and currency symbols Date: 14/10/08 15:52 Hi Andy One method is to save the amounts * 100 as integers and divide by 100 when reading. Many mainframe systems do this. Another is to take control in your code and always save with dot as decimal separator and assume that as well when reading. This is very easy to perform: Use LTrim(Str(curAmount)) for writing the string and Val(strAmount) for reading. /gustav >>> andy at minstersystems.co.uk 14-10-2008 17:16:38 >>> Hi to the internationalists Before I cook something up myself has anyone already done this? I'm writing a system that will be run in France but will take data produced in CSV files in the UK as wel as on the continent. This means that a CSV file produced in UK will output a number as, eg, 123.45 whereas one in France will write 123,45. So I guess I'll have to read everything into a text field and parse it to write out a number in whichever is the local format (France as I say, but who knows if someone may decide to run it in UK). Anyone handled this situation and have any useful bits & pieces? -- Andy Lacey http://www.minstersystems.co.uk -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com