Ask Question Forum:
Model Library:2025-02-08:A.I. model is online auto reply
C
O
M
P
U
T
E
R
2
8
Show
#
ASK
RECENT
←
- Underline
- Bold
- Italic
- Indent
- Step
- Bullet
- Quote
- Cut
- Copy
- Paste
- Table
- Spelling
- Find & Replace
- Undo
- Redo
- Link
- Attach
- Clear
- Code
Below area will not be traslated by Google,you can input code or other languages
Hint:If find spelling error, You need to correct it,1 by 1 or ignore it (code area won't be checked).
X-position of the mouse cursor
Y-position of the mouse cursor
Y-position of the mouse cursor
Testcursor
caretPos
Attachment:===
Asked by Grizbear51
at 2024-07-21 13:05:59
Point:500 Replies:4 POST_ID:829057USER_ID:11959
Topic:
Microsoft Access Database;;
I am trying to automate this entire process without having to look it over.
I have an imported table from excel we'll call XLS_import that I have automated to import by button.
It has several date fields and like always the dates come in many formats from the user.
What I need to do is clean them up in a query.
I need the date to stay a text field.
I would like to say in the query if len<10 then add the right amount of zeros.
so that
1/1/2014 would end up 01/01/2014
0r 1/12/2014 would end up 01/12/2014.
Any help would be apprieciated
I have an imported table from excel we'll call XLS_import that I have automated to import by button.
It has several date fields and like always the dates come in many formats from the user.
What I need to do is clean them up in a query.
I need the date to stay a text field.
I would like to say in the query if len<10 then add the right amount of zeros.
so that
1/1/2014 would end up 01/01/2014
0r 1/12/2014 would end up 01/12/2014.
Any help would be apprieciated
Author: Grizbear51 replied at 2024-07-21 14:48:36
Thanks easy and small always the perfect code.
Author: Grizbear51 replied at 2024-07-21 14:47:46
cool at first I typed it in and it didnt work butthen I went thru the formula builder to see if I was missing anything and then it worked. Thanks a lot. I also had to add for is null so the formular ended up
IIf(IsNull([Date],[Date],Format(DateValue([Date]),"mm/dd/yyyy")) and it works perfect!
Thank you so much.
IIf(IsNull([Date],[Date],Format(DateValue([Date]),"mm/dd/yyyy")) and it works perfect!
Thank you so much.
Expert: duncanb7 replied at 2024-07-21 14:30:44
Take a look for Format() function manual from MS at http://msdn.microsoft.com/en-us/library/office/gg251755(v=office.15).aspx
you can do this, probably you will put the date string into Excel cell
such as at Cell A1
Duncan
Sub test()
Range("A2") = Format(DateValue(Range("A1")), "dd/mm/yyyy")
Range("A2").NumberFormat = ("dd/mm/yyyy")
End Sub
you can do this, probably you will put the date string into Excel cell
such as at Cell A1
Duncan
Sub test()
Range("A2") = Format(DateValue(Range("A1")), "dd/mm/yyyy")
Range("A2").NumberFormat = ("dd/mm/yyyy")
End Sub
Accepted Solution
Expert: Rgonzo1971 replied at 2024-07-21 13:13:06
500 points EXCELLENT
Maybe
strRes = Format(DateValue (strYourDate), "mm/dd/yyyy")
Regards
strRes = Format(DateValue (strYourDate), "mm/dd/yyyy")
Regards