If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
extract date from text field
Hello,
I am new to access (2003) so may not use the correct terminology. I want to extract a 'date' from a text field to populate another field. As well I need to extract a string of numbers to fill another field. SceneID=catDALI_a2155342430807171842022J_a26S5G2J2 00807171841140LMLMMX_satShift0_seg5278220. The KJ to extract is 534243 The SceneDate to extract is 080717 The SceneID will always have the same structure. |
#2
|
|||
|
|||
extract date from text field
If you just want 080717:
SceneDate: Mid([SceneID],19,6) If you want an actual date the following should work assuming that SceneDate 080717 is 7/17/2008: SceneDate: CDate(Mid([SceneID],21,2) & "/" & Mid([SceneID],23,2) & "/" & Mid([SceneID],19,2)) I'm also assuming that the string always has the same number of characters in the same order. Plus the date part of the string will always be a valid date. CDate chokes on an invalid date. KJ: Mid([SceneID],13,6) -- Jerry Whittle, Microsoft Access MVP Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder. "Sparky" wrote: Hello, I am new to access (2003) so may not use the correct terminology. I want to extract a 'date' from a text field to populate another field. As well I need to extract a string of numbers to fill another field. SceneID=catDALI_a2155342430807171842022J_a26S5G2J2 00807171841140LMLMMX_satShift0_seg5278220. The KJ to extract is 534243 The SceneDate to extract is 080717 The SceneID will always have the same structure. |
Thread Tools | |
Display Modes | |
|
|