Displaying Today's Date as 'Today'

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
 
K

Keith Wilby

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
 
J

JamesJ

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
 
J

JamesJ

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
 
M

Mr. B

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
 
M

Mike Painter

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.
 
S

Stefan Hoffmann

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 <--
 
A

AccessVandal via AccessMonster.com

I would suggest that you that you create another control in form with its
control source and bound to a builtin function

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

(if your textbox name is “ReminderDateâ€)

You getting the error because the textbox is bound to the table field/column
where the datatype is “Date/Time†and any attempt to modify to a datatype in
your case is “Text†will create an error.
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
 
K

Keith Wilby

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
 
J

JamesJ

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.
 
J

JamesJ

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.
 
J

JamesJ

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
 
D

Douglas J. Steele

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
 
J

JamesJ

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
 
A

AccessVandal via AccessMonster.com

Somehow, something tells me that you are inserting redundant data into the
table.
 
J

JamesJ

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
 
A

AccessVandal via AccessMonster.com

Good to hear, you don't need to add a new field/column into the table for a
calculated field.
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
Somehow, something tells me that you are inserting redundant data into the
table.
[quoted text clipped - 8 lines]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top