Submitted by jan_rifkinson on 2009/05/19 13:24
What -- if anything -- is wrong the following?
 
<source>SELECT ItemID, Format([ApptDate],"ddd") AS DayFROM ¯qApptDate;</source>|<source>SELECT ItemID, Format([DateDue],"ddd") AS DayFROM ¯qDateDue;</source>
 
Thank you.
 
--
Jan Rifkinson
Ridgefield CT USA

Comments

jan_rifkinson

2009/05/20 08:53

In reply to by Pierre_Admin

I wanted IQ to translate both ApptDate & DateDue dates into day of the week
 
--
Jan Rifkinson
Ridgefield CT USA
HP Blackbird Vista Ultimate SP-1

Pierre_Admin

2009/05/20 09:06

In reply to by jan_rifkinson

You can't do it for 2 fields at once (how would IQ know which date to use if both are filled?)
 
You create a field for the day of ApptDate and another for the day of DateDue
 
If you want to be fancy, you could create a field that would be the max (or min) of both dates and find the day of that field
 

jan_rifkinson

2009/05/20 09:51

In reply to by Pierre_Admin

> You can't do it for 2 fields at once (how would IQ know which date to use if both are filler
 
I thought perhaps there was an 'or' function that might work here.
 
--
Jan Rifkinson
Ridgefield CT USA
HP Blackbird Vista Ultimate SP-1

Pierre_Admin

2009/05/20 10:00

In reply to by jan_rifkinson

Well... if you insist...
 
Enter the following in the options of a text field, named "Day"
<source>SELECT ¯qItemCreated.ItemID, Format(IIf(IsNull([datedue]),[ItemCreated],[DateDue]),"ddd") AS [day]
FROM ¯qItemCreated LEFT JOIN ¯qDateDue ON ¯qItemCreated.ItemID = ¯qDateDue.ItemID;
</source>
 
 
The field Day should display the Day of DateDue if present, otherwise the day of ItemCreated
 

jan_rifkinson

2009/05/20 12:34

In reply to by Pierre_Admin

Thanks, Pierre. Could I insist a little more and ask if it's possible that the two dates be DateDue & ApptDate?  Thanks.
 
--
Jan Rifkinson
Ridgefield CT USA
HP Blackbird Vista Ultimate SP-1

Pierre_Admin

2009/05/20 13:06

In reply to by jan_rifkinson

In the example above, simply replace all ItemCreated with ApptDate

jan_rifkinson

2009/05/20 13:08

In reply to by Pierre_Admin

oh... cool. I wasn't sure if one had to be automated, i.e. itemcreated but that's terrific. thanks again.
 
--
Jan Rifkinson
Ridgefield CT USA
HP Blackbird Vista Ultimate SP-1