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.

Solved: Access, Date/Time Field to String -- is it possible

Discussion in 'Business Applications' started by piamik2, Feb 2, 2006.

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

    piamik2 Thread Starter

    Joined:
    Mar 30, 2005
    Messages:
    120
    I have a field that is date/time, formatted to display the long date (which starts with the day of the week). This has been extremely useful for some append, update and delete queries.

    However, I would like to be able to do an update query based on the day of the week for each record. I know that the date/time field is stored as a number so I can't search for any string of letters. But, is there a way to take the long date format and copy what's there as a string so I can then extract the day of the week out of it? Otherwise, I guess I'm stuck with adding a separate field for day of the week, and manually inputting it. Seems like such a waste.
     
  2. Anne Troy

    Anne Troy

    Joined:
    Feb 14, 1999
    Messages:
    11,746
    First Name:
    Anne
    Why not get the field in your query and format it as ddd? That should also show only the day.
     
  3. piamik2

    piamik2 Thread Starter

    Joined:
    Mar 30, 2005
    Messages:
    120
    I must be doing something wrong. I was only coming up with the number of the day of the month, rather than say Friday. I'll look again.
     
  4. Anne Troy

    Anne Troy

    Joined:
    Feb 14, 1999
    Messages:
    11,746
    First Name:
    Anne
    d or dd should be 1 or 01, but ddd should give you the day. It might even show Mon for Monday. Try dddd, maybe. I forget... :)
     
  5. piamik2

    piamik2 Thread Starter

    Joined:
    Mar 30, 2005
    Messages:
    120
    Well, I'm not real proficient at coding and I'm not querying properly--just getting error messages.

    So, if I have a query with a field called PerformanceDate which is a date/time field, how would I set the criteria with the ddd so that only dates that fell on a Friday appeared? I tried with DatePart, but it seems to only want the day in d or dd.
     
  6. piamik2

    piamik2 Thread Starter

    Joined:
    Mar 30, 2005
    Messages:
    120
    Did a little more research and I got it. I used Weekday([PerformanceDate])=6 to give me all the dates occurring on Fridays. Thanks for your help
     
  7. Sponsor

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/439463

  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