?
Solved

date/time field splitting

Posted on 2002-03-04
5
Medium Priority
?
138 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 120 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

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

Question has a verified solution.

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

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…
Suggested Courses
Course of the Month15 days, 20 hours left to enroll

850 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