Solved

date/time field splitting

Posted on 2002-03-04
5
132 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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

Suggested Solutions

You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

730 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