#1
|
|||
|
|||
Converting a date to sring using FORMAT() gives wrong format
Hi
I'm creating an Excel converter app, which reads data from client's forecast file, and writes a text file used to import those data to ERP program. I tried in VBA procedure to convert date to string, using code like: Code:
... strDateString = Format(datDate, strDateFormat) ... |
#2
|
||||
|
||||
Just a notion, but you say you're writing out the results in a text file. Any chance you mean it's CSV? A CSV doesn't know anything about formatting. If not, we might need more detail about how you know what format is being returned. I know, it sounds silly, but silly mistakes do exist out there.
|
#3
|
|||
|
|||
The target file for this particular SetUp is a text file, which is used to import some info (sent by client) into ERP application. The converter may be used in one country, or by person having any local settings in his/her computer, and ERP application may be work in entirely another country. And the client my reside in third country. The format the imported dates must have, is determined on converter's SetUp sheet.
In converter's SetUp, the user determines settings for source and target file (file types of source file can be like text file, or Excel workbook, or CSV file, or HTML-file, and are in SetUp determined for client). Then user clicks a button to read in the source file, and app checks the source file structure and the presence of data in it, after that reads the source file data in (source file type is determined in and makes all nesseccary calculations - like source table can have data table like list, or may have the table where data is stored columnwise, or there are weekly, or monthly rows and those must be consolidated or distributed according the SetUp, etc.). And finally read in and converted data are writen into converter's target table, having one column there for dates in datestring format usable for ERP application, the forecast is meant to. Clicking the another button, the app reads the data of certain forecast from converter's table, and writes those data into text file in format readable by ERP application (all this based on Setup settings again). I mark the case closed, as I simply got the datestring composed from year, month and day strings, using some amount of script to analyze the date format string determined in app's SetUp to do this properly. |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Mail merge field mistakenly interpret text format as date format | alan6690 | Mail Merge | 0 | 09-02-2020 01:54 AM |
Date is displayed in the wrong format | shawn.low@cox.net | Mail Merge | 1 | 12-28-2019 02:17 AM |
Converting letter format documents to A4 format | TJB | Word | 1 | 06-01-2016 06:35 AM |
converting mm.s format to mm:ss | derohanes | Excel | 12 | 10-30-2012 08:34 AM |
Converting from DOC files to PDF format | obenix | Word | 2 | 04-29-2005 04:06 AM |