IIf(Time()>=TimeValue("00:00:00");IIf(Time()<=TimeValue("07:00:00");Format(Now()-1;"dd mm yyyy");Format(Now();"dd mm yyyy")))
Appienator
Recommended Answers
Jump to PostSo if I understand this, you want any date/time after midnight and before 7am to report as the previous day, anything after 7am until midnight to show as current day.
Sleeves rolled up...
You aren't going to like this...it's ugly but it will work on SQL2000 - 2008.
Jump to PostIt does not matter how the code looks or anyone likes it or not CASE is the solution.
And CASE works really faster.
Jump to Postwhy not post your original access query , we can fix that .
Jump to PostFirst, let me just say that Access SQL is an abomination. Not your fault, just my opinion.
Second, I don't speak German, so I have to make some assumptions about what all your columns are, at least as far as datatypes. Here is the table I created, with a test …
All 13 Replies
BitBlt
452
Practically a Master Poster
Featured Poster
debasisdas
580
Posting Genius
Featured Poster
Appienator
debasisdas
580
Posting Genius
Featured Poster
Appienator
BitBlt
452
Practically a Master Poster
Featured Poster
debasisdas
commented:
that is a lot of selfless effort trying to help someone.
+8
Appienator
BitBlt
452
Practically a Master Poster
Featured Poster
Appienator
Appienator
BitBlt
452
Practically a Master Poster
Featured Poster
debasisdas
580
Posting Genius
Featured Poster
Appienator
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.