473,508 Members | 2,370 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Convert a date to a text string

1 New Member
I have a problem at how best to convert a Date into a text field and keep the format dd/mmm/yyyy (01-FEB-2007).

The problem is that dates are imported from SQL into an access front end Database. When the dates are imported they are in the format dd/mm/yyyy.
However on the reports the dates are in the in the format dd/mmm/yyyy.

I now need to allow the fields to accept an asterix (*) as a prefix to the date to show dates that have not been imported but input manually by users.

To allow for the asterix I have changed the date/time field to a text field in the access front end. However, this now displays the date as dd/mm/yyyy and i need to format this date to dd/mmm/yyyy to give 01-Feb-2007.
Ideas greatly appriciated!
Feb 19 '07 #1
2 20956
tehgreatmg
49 New Member
The only thing I can think of to do is to break the date up to seperate dd mm yyyy. Then make a statement to compare the mm and set it to your mmm format and then just recombine everything for an output. This is probably the longest way around, I have only been using vb for about 1 yr now so I dont know many shortcuts, hope this helps.
Feb 19 '07 #2
ADezii
8,834 Recognized Expert Expert
I have a problem at how best to convert a Date into a text field and keep the format dd/mmm/yyyy (01-FEB-2007).

The problem is that dates are imported from SQL into an access front end Database. When the dates are imported they are in the format dd/mm/yyyy.
However on the reports the dates are in the in the format dd/mmm/yyyy.

I now need to allow the fields to accept an asterix (*) as a prefix to the date to show dates that have not been imported but input manually by users.

To allow for the asterix I have changed the date/time field to a text field in the access front end. However, this now displays the date as dd/mm/yyyy and i need to format this date to dd/mmm/yyyy to give 01-Feb-2007.
Ideas greatly appriciated!
This should do the trick assuming your Date Field is named [TestDate] in a Table named tblTest::
Expand|Select|Wrap|Line Numbers
  1. UPDATE tblTest SET tblTest.TestDate = Format([TestDate],"dd-mmm-yyyy")
  2. WHERE tblTest.TestDate Is Not Null;
Feb 19 '07 #3

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

Similar topics

2
39773
by: Hector A | last post by:
Hi I'm trying to convert a string that already looks like a date to a date that I can use when I pass it from java to the database. I receive the date in format yyyy-mm-dd and I need it to be a...
1
67368
by: Loi Tan Vo | last post by:
Hi, I have a text file that contains a date column. The text file will be imported to database in SQL 2000 server. After to be imported, I want to convert the date column to date type. For...
1
6145
by: WUV999U | last post by:
Hi I am fairly new to VBA and want to know how I can convert or I mean parse the XML file and convert to an access database. Please help. I greatly appreciate your time and help. I would be...
12
3827
by: DC Gringo | last post by:
How can I convert this pubLatest to a date with format "m/d/yyyy"? Dim pubLatest As New Date pubLatest = Me.SqlSelectCommand1.Parameters("@pubLatest").Value -- _____ DC G
5
12694
by: XML newbie: Urgent pls help! | last post by:
function to convert string to 1 dimensional array of long in VB.Net
2
2228
by: Learner | last post by:
Hello, I am trying to store the data entered in a webform in the database. I have few Int and one SmallDateTime filed in my table in SQL Server 2005 database. I have made a storedproc to store the...
4
4503
by: Edwin Knoppert | last post by:
In my code i use the text from a textbox and convert it to a double value. I was using Convert.ToDouble() but i'm used to convert comma to dot. This way i can assure the text is correct. However...
7
19191
by: elliotng.ee | last post by:
I have a text file that contains a header 32-bit binary. For example, the text file could be: %%This is the input text %%test.txt Date: Tue Dec 26 14:03:35 2006...
2
16765
by: thewilldog | last post by:
Hello, I've reviewed the archives here to address the issue, but I'm still running into problems. I've got a table field populated with the record date in text "YYYYMMDD" To convert it into a...
6
5238
by: Bob Altman | last post by:
Hi all, I'm looking for the fastest way to convert an array of bytes to String. I also need to convert a String back to its original Byte() representation. Convert.ToBase64String and...
0
7224
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
7118
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
7379
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7493
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5049
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3192
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3180
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1550
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
415
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.