Results 1 to 5 of 5

Thread: date problem

  1. #1
    Join Date
    Nov 2006
    Posts
    10

    Wink Unanswered: date problem

    Hi;

    Probably a stupid question from a newbie;
    I have a form with several test results taken during a 24-hour priod.
    Each test has a field with time format like this: yyyy-mm-dd hh:mm. (not primary key)
    I want to print a report based on the data in to modes.
    First one, specified by one particular time e.g. 2006-12-19 22:37.
    That’s no problem. next one, I want to print out every report during one 24-hour period.
    e.g. 2006-12-20 06:30
    2006-12-20 15:32
    2006-12-20 71:15

    i.e. all report chosen by a specific date without consideration to time. I understand I have to format date somehow in VB but how? it will not work for me.

    hope somebody have mercy

    Best Regards

    Gostap

  2. #2
    Join Date
    May 2004
    Location
    New York State
    Posts
    1,178
    I think you need the Format() function. Look it up in the help file, and be sure to read all the examples. They're very helpful.

    Sam

  3. #3
    Join Date
    Dec 2006
    Posts
    53
    It sounds like he needs something like an unformat function. The date's coming in a text field and needs to be read like a date.

    Wouldn't it just be a matter of dumping the string into a date formatted field in a table?

  4. #4
    Join Date
    May 2004
    Location
    New York State
    Posts
    1,178
    All right, in that case, look up the CDate() function, which converts a valid date string to a real date. Look up Format() as well, though. You can mix functions, ala

    Code:
    txtDateTime = Format(Cdate("some valid date string"), "some valid date format")
    Hope this helps,

    Sam

  5. #5
    Join Date
    Nov 2006
    Posts
    10

    Thanks!

    Thank you for replies!

Posting Permissions

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