N Number11 Member Local time Today, 10:22 Joined Jan 29, 2020 Messages 619 Jan 30, 2024 #1 Hwllo, so i am trying to confirm a date string and format as date 20231129 would be 29/11/2023 what's the best way to confirm via query
Hwllo, so i am trying to confirm a date string and format as date 20231129 would be 29/11/2023 what's the best way to confirm via query
T tvanstiphout Active member Local time Today, 03:22 Joined Jan 22, 2016 Messages 349 Jan 30, 2024 #2 If you add 2 dashes, you have ISO date pattern, and Access can handle it: ? IsDate("2023-11-29") True
If you add 2 dashes, you have ISO date pattern, and Access can handle it: ? IsDate("2023-11-29") True
theDBguy I’m here to help Staff member Local time Today, 03:22 Joined Oct 29, 2018 Messages 22,366 Jan 30, 2024 #3 Depending on your situation, you might also be able to do it the other way. Code: ?Format(#29/11/2023#, "yyyymmdd")="20231129" (untested) Just a thought...
Depending on your situation, you might also be able to do it the other way. Code: ?Format(#29/11/2023#, "yyyymmdd")="20231129" (untested) Just a thought...
Minty AWF VIP Local time Today, 10:22 Joined Jul 26, 2013 Messages 10,626 Jan 30, 2024 #4 As Tom says just add some - to your string and access will accept it as a date Code: RealDate: DateValue(Left(MyString,4) & "-" & Mid(MyString,5,2) & "-" & Right(MyString,2)) Last edited: Jan 30, 2024
As Tom says just add some - to your string and access will accept it as a date Code: RealDate: DateValue(Left(MyString,4) & "-" & Mid(MyString,5,2) & "-" & Right(MyString,2))
N Number11 Member Local time Today, 10:22 Joined Jan 29, 2020 Messages 619 Jan 30, 2024 #5 Thanks all i got it working using RealDate: DateSerial(Left([T_Date], 4), Mid([T_Date], 5, 2), Right([T_Date], 2)) 20231130 = 30/11/2023
Thanks all i got it working using RealDate: DateSerial(Left([T_Date], 4), Mid([T_Date], 5, 2), Right([T_Date], 2)) 20231130 = 30/11/2023
E ebs17 Well-known member Local time Today, 11:22 Joined Feb 7, 2020 Messages 2,212 Jan 30, 2024 #6 Code: CDate(Format("20231129", "@@@@-@@-@@"))