Solved

date/time field splitting

Posted on 2002-03-04
5
130 Views
Last Modified: 2010-05-02
Hello

I have created a outlook form to be used within a organisation and the form is sent to a database system.

I have a date/time field on my form.  When the user fills in the form only the date will appear.  Thats what i want.

Although when the e-mail is recieved by the database system, the date and time field is displayed.

My code is in VBScript
I have also looked in the all web sites, they have been no help

Thank you
0
Comment
Question by:BUKI
5 Comments
 
LVL 6

Expert Comment

by:sharmon
ID: 6840505
When you assign the form field to the date variable before you send the mail, use the DateValue() function and it will only return the date portion.

For example...

Dim dteDate As Date
dteDate = DateValue(Now)

Regards,
Shannon

0
 
LVL 6

Expert Comment

by:sharmon
ID: 6840509
Ah, overlooked the database portion, what database are you using?

Regards,
Shannon
0
 
LVL 17

Accepted Solution

by:
inthedark earned 30 total points
ID: 6840674
In VBScript you can use a function called Date().  The date function returnds the current date.

e.g.

Dim ThisDay

ThisDay = Date


In fact Dates are stored as numbers the integer part of the number is the date and the decimal part of the number is the time.

Therefore the following statements are true:

Date = Int(Now)

Now = Date + Time

(The Time functions returns the current time.)

Hope this helps.

In the Database system there is a problem they are not formating the dates correctly.

In Access they can set up a default format for this field, but they have not done this.

To correct the problem they can either create a format for this field or run a query like:

Update YourTable Set YourDate = Int(YourDate)



0
 
LVL 12

Expert Comment

by:guidway
ID: 7306144
This question appears to have been abandoned. A Moderator will be asked to
close this question after seven days, with the following recommended
disposition:

Points to inthedark

If you have any comment or objection to the recommendation, please leave it here.

guidway
EE Cleanup Volunteer
0
 
LVL 5

Expert Comment

by:Netminder
ID: 7331584
Per recommendation, force-accepted.

Netminder
CS Moderator
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question