My Assistant
|
|
Apr 11 2012, 07:17 PM
Post
#1
|
|
|
UtterAccess Ruler Posts: 4,237 From: Downey, CA |
I have a report that documents what I've been working on - I have a ddd format, so today Wednesday, would be Wed 5:13 p.m. for example - I'm trying to add an alias field to my query to where if the date is today's date, return Today 5:13 p.m. otherwise if it was yesterday or the day before, I want say Tues 3:57 p.m for example.
If it was a week ago, I would want the month number and day ONLY, i.e, Tues 4/3, with no time of day here is my sql CODE SELECT TOP 25 tblProjectWorkLog.ID, tblProjectWorkLog.ProjID, tblProjectWorkLog.Start, tblProjectWorkLog.End, tblProjectWorkLog.Completed, tblProjectWorkLog.Notes, tblProjectWorkLog.DateUpdated FROM tblProjectWorkLog and the alias attempt that did NOT work: CODE StrtDt: IIf([start]=Date(),"Today",[start]) |
|
|
|
![]() |
Apr 12 2012, 03:29 PM
Post
#2
|
|
|
UtterAccess Guru Posts: 805 |
QUOTE bob - thx but I didn't get the CatID part '********************************************** This was just a field in my test table. It's not significant to the Switch()function and can be eliminated without harm. Bob |
|
|
|
bakersburg9 Return "today" If Current Date, Actual Date Otherwise Apr 11 2012, 07:17 PM
GroverParkGeorge If you are storing your [start] values with a time... Apr 11 2012, 07:31 PM
John Vinson try:
=IIF(DateValue([start]) = Date(), TimeValue(... Apr 11 2012, 07:52 PM
raskew Hi -
The Switch() function may do it for you. He... Apr 12 2012, 02:13 AM
Gustav You could use:
StrtDt: Format([Start], IIf(DateVa... Apr 12 2012, 05:29 AM
bakersburg9 QUOTE (raskew @ Apr 12 2012, 07:13 AM) Th... Apr 12 2012, 12:20 PM
raskew Hi -
Here's a tested example. You'll nee... Apr 12 2012, 01:48 PM
bakersburg9 QUOTE (raskew @ Apr 12 2012, 06:48 PM) Hi... Apr 12 2012, 01:56 PM
Jeff B. Uhm...? I may be missing something, but if you ru... Apr 12 2012, 01:56 PM
bakersburg9 QUOTE (Jeff B. @ Apr 12 2012, 06:56 PM) U... Apr 12 2012, 01:58 PM
raskew Hi -
I'm confused. You've double-posted ... Apr 12 2012, 04:58 PM
bakersburg9 QUOTE (raskew @ Apr 12 2012, 09:58 PM) Yo... Apr 13 2012, 11:10 AM
raskew Hi -
Copy/paste this to a new query, then run it.... Apr 13 2012, 12:34 PM
bakersburg9 bob - appreciate your help - got an error message ... Apr 13 2012, 01:02 PM![]() ![]() |
|
Go to Top · Lo-Fi Version | Time is now: 22nd May 2013 - 06:55 AM |