1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

a problem with my VB code in MS access?

Discussion in 'Software Development' started by djfortafan, Oct 4, 2004.

Thread Status:
Not open for further replies.
Advertisement
  1. djfortafan

    djfortafan Thread Starter

    Joined:
    Oct 29, 2001
    Messages:
    46
    I have an open issue in the Business Applications thread involving VB in MS Access, and thought maybe some of you guys/girls in the Developement thread might be able to help. I am trying to retrieve the date only, (not date/time) from an activeX control. for more info, read on here:http://forums.techguy.org/showthread.php?p=1986647#post1986647.

    Thank you in advance!
     
  2. coderitr

    coderitr

    Joined:
    Oct 12, 2003
    Messages:
    3,015
    I don't think you can make the DTPicker control return only the date portion but you can truncate the value before you use it. Use Fix( ) to remove the time portion.
     
  3. djfortafan

    djfortafan Thread Starter

    Joined:
    Oct 29, 2001
    Messages:
    46
    how does the fix() function work? What is the syntax? Can I use that tight in my query criteria in access or would it be in the VB code?
     
  4. coderitr

    coderitr

    Joined:
    Oct 12, 2003
    Messages:
    3,015
    Here is the MSDN article about the Fix( ) function

    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/script56/html/vsfctint.asp

    The article refers to this function only in reference to numbers but I'm fairly sure that it will work with dates as well -- returning only the date portion of the value.

    You won't be able to use that function embedded in SQL. You'll have to use it in vbscript and get the value to your query another way. I could be wrong about that though.
     
As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/280990

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice