We have a Date/Time Stamp field in our database. I need to extract just the date portion of that field (as date, not text), so we can do queries on it (allow users to enter a date and have it return all records entered on that date).
I agree, unfortunately I do not think that is an option I have at my disposal.
We are using software that uses SQL. It has a built in Report feature, with a built GUI criteria section. On the Criteria section, it allows you to enter a date and it will compare the date entered to any field or variable you designate (what I am trying to create).
99% of the time, users are going to want to see the records posted today or yesterday (but only on one day), so they are going to select the "Equals to" option and enter their date. They are not very computer savvy, so I really can't ask them to use things like Greater Than (which wouldn't work anyway if they ONLY wanted to see Yesterday, or some other past day's postings).
So, if every date in SQL has a time component (which I think it does), then I believe I just need to convert the Date/Time Stamp to change the time piece to 0:00? Does that sound right?
Brilliant! I think that does what I need it to. I tested it out in an Ad Hoc Query, and it appears to work. I'll see if it works when I incorporate it into the Report program.
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.