DATE/TIME DILEMMA - HELP, Please. Thanks.

Results 1 to 5 of 5

Thread: DATE/TIME DILEMMA - HELP, Please. Thanks.

  1. #1
    Jose Fernandez Guest

    Default DATE/TIME DILEMMA - HELP, Please. Thanks.

    I&#039m using an Access database. I save to it from a form. I have a field call ExpirationDate, I enter: 01/01/1998. Later when a retrived that record and look at the content of the field, guess what: It shows 12:00:43AM - This field is defined as Date/Time in the database. I don&#039t care about the time, only need the correct date. Also I want to have in the MM/DD/YYYY format. Thanks in advance.

  2. #2
    Join Date
    Dec 1969
    Posts
    27

    Default RE: DATE/TIME DILEMMA - HELP, Please. Thanks.

    Try this function:<BR><BR>&#060;% Dim D,M<BR> D = Day(Now)<BR> M = Month(Now)<BR> If D &#060;= 9 Then<BR> D = "0" & D<BR> End If<BR> If M &#060;= 9 Then<BR> M = "0" & M<BR> End If<BR> DateAdded="" & M & "/" & D & "/" & Year(Date) & ""<BR>%&#062;

  3. #3
    Jose Fernandez Guest

    Default RE: DATE/TIME DILEMMA - HELP.

    Thanks, Penny. The date I need to save in in the future, not today or now. And also I&#039ll be querying from this field so can&#039t be text. Still need help. HELP!!!

  4. #4
    Shibu Guest

    Default RE: DATE/TIME DILEMMA - HELP.

    Hi Jose, u can specify the format for date/time field in access table design. and also u will get the day, month and year from any date/time field or from a date field by using day(), month(), year() functions respectively. check for it...


  5. #5
    Join Date
    Dec 1969
    Posts
    27

    Default RE: DATE/TIME DILEMMA - HELP.

    You don&#039t need to use the today or now function. What about using list boxes to receive the date. eg:<BR><BR>&#060;% Dim D,M<BR> D = Request.Form("selDay")<BR> M = Request.Form("selMonth")<BR> Y = Request.Form("selYear")<BR> If D &#060;= 9 Then<BR> D = "0" & D<BR> End If<BR> If M &#060;= 9 Then<BR> M = "0" & M<BR> End If<BR> DateAdded="" & D & "/" & M & "/" & Y & ""<BR>%&#062;<BR>This can be saved into a date field so it doesn&#039t have to be text.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •