Solved

date/time field splitting

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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
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 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…
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…

760 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now