Iif statement that sees the formmatted date value on query table

G

Guest

I have a query date long date field and an expression the formats the long
date to weekdays. I can't seem to create a report Iif statement that can see
the weekdays, no problem writing a statement that finds the long date.
 
M

Marshall Barton

firefly40 said:
I have a query date long date field and an expression the formats the long
date to weekdays. I can't seem to create a report Iif statement that can see
the weekdays, no problem writing a statement that finds the long date.


You have some kind of misperception. The format of a value
is irrelevant when using the value. The format just
specifies how you want the value to appear in a control on a
form/report.

You should restate your question in terms of what you are
trying to acccomplish what the date field (better not be a
text field).

Note that there are many date related functions that can be
used to help with whatever you are trying to do:

the dddd format code displays the day of the week, e.g
Monday

DatePart("w", date) is the number of the weekday, e.g. 2

The former is useful to display the weekday for people to
see. The latter is useful when you want to sort by the week
day.

Check VBA Help for details.
 
G

Guest

Marsh, thanks for your input, I am not very good with Access and suffer more
with the corrrect termonilogy. I did find what I was looking for using
=Iif(DatePart("w",[WEEKDAY])="3",[SumOfLABORHRS],""). I am using this
information to build a weekly schedule report.
 
M

Marshall Barton

firefly40 said:
Marsh, thanks for your input, I am not very good with Access and suffer more
with the corrrect termonilogy. I did find what I was looking for using
=Iif(DatePart("w",[WEEKDAY])="3",[SumOfLABORHRS],""). I am using this
information to build a weekly schedule report.


You should not compare a number to a text string. Even if
Access usually(?) converts correctly, that should be:

=Iif(DatePart("w",[WEEKDAY])=3,[SumOfLABORHRS],Null)
 

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