Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 09-06-2023, 09:09 AM
ArviLaanemets ArviLaanemets is offline Converting a date to sring using FORMAT() gives wrong format Windows 8 Converting a date to sring using FORMAT() gives wrong format Office 2016
Expert
Converting a date to sring using FORMAT() gives wrong format
 
Join Date: May 2017
Posts: 932
ArviLaanemets has a brilliant futureArviLaanemets has a brilliant futureArviLaanemets has a brilliant futureArviLaanemets has a brilliant futureArviLaanemets has a brilliant futureArviLaanemets has a brilliant futureArviLaanemets has a brilliant futureArviLaanemets has a brilliant futureArviLaanemets has a brilliant futureArviLaanemets has a brilliant futureArviLaanemets has a brilliant future
Default 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)
...
where strDateformat is "dd/mm/yyyy" (it is read from Setup sheet of converter, i.e. user can determine, what the format must be). The local date format for my computer is "dd.mm.yyyy", and this is the format the VBA returns. (And this is really what the Format() function returns - I checked it in Immediate window!). So what about Format function converting the date to string in given format?
Reply With Quote
 



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 a date to sring using FORMAT() gives wrong format Converting letter format documents to A4 format TJB Word 1 06-01-2016 06:35 AM
Converting a date to sring using FORMAT() gives wrong format converting mm.s format to mm:ss derohanes Excel 12 10-30-2012 08:34 AM
Converting a date to sring using FORMAT() gives wrong format Converting from DOC files to PDF format obenix Word 2 04-29-2005 04:06 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 02:54 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft