473,385 Members | 1,185 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,385 software developers and data experts.

Strip time from date?

Could someone help me work out out a way to either convert a smalldatetime
value from my database(access) to a normal date with out the trailing time.

Is it simple matter of using FormatDate or does one need to do string
maniupulation?

Current
9/13/2003 11:36:00 AM

What I want:
9/13/2003

Thanks
Jason


Jul 19 '05 #1
2 3600
If it's just for display then use FormatDateTime

"jason" <ja***@catamaranco.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
Could someone help me work out out a way to either convert a smalldatetime
value from my database(access) to a normal date with out the trailing time.
Is it simple matter of using FormatDate or does one need to do string
maniupulation?

Current
9/13/2003 11:36:00 AM

What I want:
9/13/2003

Thanks
Jason

Jul 19 '05 #2
If all you want to store in the database is the date then set this in the
field properties in access

For presentation purposes use

dtmDate = "9/13/2003 11:36:00 AM" ' rs("date_field")
dtmDate = ConvertDate(dtmDate)

Function ConvertDate(str1)
ConvertDate = "NAD"
If IsDate(str1) Then
ConvertDate= FormatDateTime(str1,2)
End If
End Function
-dlbjr

invariable unerring alien
Jul 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

16
by: PK9 | last post by:
I have a string variable that holds the equivalent of a DateTime value. I pulled this datetime from the database and I want to strip off the time portion before displaying to the user. I am...
9
by: scott | last post by:
I have a field with datetime values like below LISTING 1. Can someone help me write code strip the time part so only values like "7/15/2005" will be left. Note - We must be able to strip dates...
3
by: Michael Evanchik | last post by:
I was coding along in asp.net (which i must say is great) But using the tab control that microsoft made, when i click on other tabs and go to print(native internet explorer print) it does not print...
3
by: Michal A. Valasek | last post by:
Hello, I want to transform text with HTML markup to plain text. Is there some simple way how to do it? I can surely write my own function, which would simply strip everything with < and >....
15
by: justinf | last post by:
Hello! I'm looking for help on how to strip time data of my date string. The information in each field is extracted from another type database into access. For example: 12/31/2007 12:34:56:789...
6
by: aiwarrior | last post by:
Hi Im writing a personal wrapper to the perl script offered by rapidshare, so that im able to use multiple files and glob pathnames, but im using a file so i can track and resume any uploading...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

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.