473,395 Members | 1,537 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

converting text string to date

7 of 9
23
Ok here is the problem I have a field (Fdate) that contains dates as a string in the Century, Year, Month, Day format ex. 1070308 is March 8th 2007 . I need to convert this to MM/DD/YY format (03/08/07) how do i do this?
May 31 '07 #1
3 2522
Rabbit
12,516 Expert Mod 8TB
Take a look at the CDate function. That coupled with the Mid function will get you what you need.
May 31 '07 #2
7 of 9
23
Take a look at the CDate function. That coupled with the Mid function will get you what you need.
Thanks I use the following
Date: Mid([FMDATE],4,2) & "/" & Right([FMDATE],2) & "/" & Mid([FMDATE],2,2)
May 31 '07 #3
Rabbit
12,516 Expert Mod 8TB
Thanks I use the following
Date: Mid([FMDATE],4,2) & "/" & Right([FMDATE],2) & "/" & Mid([FMDATE],2,2)
Very good, although you might want to use CDate as well to make it a date value. Right now it's probably considered a string. You also shouldn't name the field Date.
May 31 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Gary Smith | last post by:
I my SQL Datareader I am loading the date data into text box. Here is my code txtActOpenDate.Text = MyDataReader("ActOpenDt").ToString() txtActOpenDate.Text is displaying the date and...
5
by: Robert | last post by:
I have a series of web applications (configured as separate applications) on a server. There is a main application at the root and then several virtual directories that are independant...
32
by: robert d via AccessMonster.com | last post by:
I'm looking at converting DAO to ADO in my app. All of my DAO connections are of the following structure: Dim wsName As DAO.Workspace Dim dbName As DAO.Database Dim rsName As DAO.Recordset ...
2
by: XML newbie: Urgent pls help! | last post by:
Does anyone have a snippet of code that will convert a string to a long array? I've nearly smashed my head against the wall trying to figure this out. I'm Using vb.net 2005 Pls reply asap. I...
12
by: Rob Meade | last post by:
Hi all, Ok - I've come from a 1.1 background - and previously I've never had any problem with doing this: Response.Write (Session("MyDate").ToString("dd/MM/yyyy")) So, I might get this for...
8
by: Steve Cartnal | last post by:
I have tried every function that seemed applicable and can't seem to convert a simple text field containing numbers, for example "022807", into a date. Nor can I do the reverse and convert a date...
1
by: Brad Pears | last post by:
I am using vb.net 2005 and SQL server 2000. In my table I have a date field of type "smalldatetime". In my vb application, the user may or may not enter a date value into the appropriate text box....
3
by: Jef Driesen | last post by:
How can I convert a date string to a number (e.g. a time_t value or a tm struct)? I know about the strptime function, but then I have to know the format string. And that is a problem. I'm trying...
6
by: sweatha | last post by:
Hi I have to select count(Date) from Appointment table having count<5. If count(Date)<5 then I should insert the data from my page. For that I have given the coding as protected void...
3
by: kronus | last post by:
I'm receiving an xml file that has a child called modified and it represents a date value in the form of a string -- Nov 14, 2008 -- and in my app, I have items associated with each object and I'm...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.