Displaying Today's Date as 'Today'

  • Thread starter Thread starter JamesJ
  • Start date Start date
J

JamesJ

I have a form with date sensitive records. If the record's date is today's
date
is it possibly to display it as 'Today as apposed to the actual date??

James
 
JamesJ said:
I have a form with date sensitive records. If the record's date is today's
date
is it possibly to display it as 'Today as apposed to the actual date??

James

Try this in your query:

Iif([MyDateField]=Date(),"Today",[MyDateField])

Keith.
www.keithwilby.co.uk
 
I have the following Select statement as the Record Source of the continuous
form,
Displaying records with dates 7 days in advance:

SELECT * FROM tblReminders WHERE (((ReminderDate)<Date()+6)) ORDER BY
ReminderDate, ReminderTime, Reminder;

Not sure where it will fit in this.
Can I place it somewhere else?

James

Keith Wilby said:
JamesJ said:
I have a form with date sensitive records. If the record's date is today's
date
is it possibly to display it as 'Today as apposed to the actual date??

James

Try this in your query:

Iif([MyDateField]=Date(),"Today",[MyDateField])

Keith.
www.keithwilby.co.uk
 
Any other takers?
I created a query and inserted the expression into the criteria for the date
field:

IIf([ReminderDate]=Date(),"Today",[ReminderDate])

Keep getting a Data Type Mismatch.

James

Keith Wilby said:
JamesJ said:
I have a form with date sensitive records. If the record's date is today's
date
is it possibly to display it as 'Today as apposed to the actual date??

James

Try this in your query:

Iif([MyDateField]=Date(),"Today",[MyDateField])

Keith.
www.keithwilby.co.uk
 
JamesJ,

In a column of your query try pasting the following:

Date: Iif([MyDateField]=Date(),"Today",[MyDateField])

Make sure that "MyDateField" is changed to the actual name of the field
where you want to check the date.

HTH
Mr. B
askdoctoraccess dot com

JamesJ said:
Any other takers?
I created a query and inserted the expression into the criteria for the date
field:

IIf([ReminderDate]=Date(),"Today",[ReminderDate])

Keep getting a Data Type Mismatch.

James

Keith Wilby said:
JamesJ said:
I have a form with date sensitive records. If the record's date is today's
date
is it possibly to display it as 'Today as apposed to the actual date??

James

Try this in your query:

Iif([MyDateField]=Date(),"Today",[MyDateField])

Keith.
www.keithwilby.co.uk
 
JamesJ said:
Any other takers?
I created a query and inserted the expression into the criteria for
the date field:
Criteria limits your selection in a query.
"Tom" in a FirstName Field would only show pwoplw named Tom.
Add
DisplayDate: IIf([ReminderDate]=Date(),"Today",[ReminderDate])
as a new field in the query, not in the criteria.
You may have to format the reminderdate before it displays but try it this
way first.
 
hi James,
I have a form with date sensitive records. If the record's date is
today's date
is it possibly to display it as 'Today as apposed to the actual date??
As Date/Time fields may contain a time part you may need to strip it,
before testing, e.g.:

DateValue([yourDateField]) = Date()


mfG
--> stefan <--
 
JamesJ said:
Any other takers?
I created a query and inserted the expression into the criteria for the
date field:

IIf([ReminderDate]=Date(),"Today",[ReminderDate])

Keep getting a Data Type Mismatch.

Hi James.

Use the expression as a caculated field in the stored query and bind a text
box to it on your form.

RemDate: IIf([ReminderDate]=Date(),"Today",[ReminderDate])

Keith.
www.keithwilby.co.uk
 
Sorry 'bout the delay.
I copied and pasted - DisplayDate:
IIf([ReminderDate]=Date(),"Today",[ReminderDate])
into the Field column of the query. IOn datasheet view it displays the same
as ReminderDate
even though I added a record with ReminderDate dated for today.

James

Mike Painter said:
JamesJ said:
Any other takers?
I created a query and inserted the expression into the criteria for
the date field:
Criteria limits your selection in a query.
"Tom" in a FirstName Field would only show pwoplw named Tom.
Add
DisplayDate: IIf([ReminderDate]=Date(),"Today",[ReminderDate])
as a new field in the query, not in the criteria.
You may have to format the reminderdate before it displays but try it this
way first.
 
I finally got it to work.
After adding the field to the table and the field to the query with the
expression
it was displaying 'Today' in the DisplayDate column but not in the
ReminderDate
column. So, I removed ReminderDate from the query.
When adding or editing records, though, I use ReminderDate.

James

Mike Painter said:
JamesJ said:
Any other takers?
I created a query and inserted the expression into the criteria for
the date field:
Criteria limits your selection in a query.
"Tom" in a FirstName Field would only show pwoplw named Tom.
Add
DisplayDate: IIf([ReminderDate]=Date(),"Today",[ReminderDate])
as a new field in the query, not in the criteria.
You may have to format the reminderdate before it displays but try it this
way first.
 
That's what I did. It does display as 'Today'. Only problem
I'm unable to apply a date format to it. In other words I woulkd
like all other dates to display ddd, dd/mm/yyyy. I'm able to assign this
date
format to ReminderDate but not to RemDate. RemDate displays mm/dd/yyyy.

James

Keith Wilby said:
JamesJ said:
Any other takers?
I created a query and inserted the expression into the criteria for the
date field:

IIf([ReminderDate]=Date(),"Today",[ReminderDate])

Keep getting a Data Type Mismatch.

Hi James.

Use the expression as a caculated field in the stored query and bind a
text box to it on your form.

RemDate: IIf([ReminderDate]=Date(),"Today",[ReminderDate])

Keith.
www.keithwilby.co.uk
 
IIf([ReminderDate]=Date(),"Today",Format([ReminderDate], "ddd,
dd/mm/yyyy"))

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


JamesJ said:
That's what I did. It does display as 'Today'. Only problem
I'm unable to apply a date format to it. In other words I woulkd
like all other dates to display ddd, dd/mm/yyyy. I'm able to assign this
date
format to ReminderDate but not to RemDate. RemDate displays mm/dd/yyyy.

James

Keith Wilby said:
JamesJ said:
Any other takers?
I created a query and inserted the expression into the criteria for the
date field:

IIf([ReminderDate]=Date(),"Today",[ReminderDate])

Keep getting a Data Type Mismatch.

Hi James.

Use the expression as a caculated field in the stored query and bind a
text box to it on your form.

RemDate: IIf([ReminderDate]=Date(),"Today",[ReminderDate])

Keith.
www.keithwilby.co.uk
 
Thanks much.
Works great.
Sorry 'bout how I reply to the threads if it was wrong. Sometimes I
don't pay attention and reply to myself when I should be replying to
the the replier.... whatever.

Thanks again to all.
James

Douglas J. Steele said:
IIf([ReminderDate]=Date(),"Today",Format([ReminderDate], "ddd,
dd/mm/yyyy"))

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


JamesJ said:
That's what I did. It does display as 'Today'. Only problem
I'm unable to apply a date format to it. In other words I woulkd
like all other dates to display ddd, dd/mm/yyyy. I'm able to assign this
date
format to ReminderDate but not to RemDate. RemDate displays mm/dd/yyyy.

James

Keith Wilby said:
Any other takers?
I created a query and inserted the expression into the criteria for the
date field:

IIf([ReminderDate]=Date(),"Today",[ReminderDate])

Keep getting a Data Type Mismatch.


Hi James.

Use the expression as a caculated field in the stored query and bind a
text box to it on your form.

RemDate: IIf([ReminderDate]=Date(),"Today",[ReminderDate])

Keith.
www.keithwilby.co.uk
 
That was it. I felt I needed to add a field to the table, but I didn't.
I just got a bit confused. Didn't know one could add an expression
or the like to a query like one adds a field.

Thanks,
James
 
Back
Top