Problem with iif and datediff expression in form

Hi,
I have a form where I have to display the value of the field based on some 
criteria. 
The first criteria is 

=IIf((DateDiff("d",[dbo_PWO_Status].[WorkOrderDate],Now())-180)>0,"Y","") 
and the second criteria to add is 

dbo_PWO_Status.[Quote] =  -1

My first question is how do I accommodate the dbo_PWO_Status.[Quote] =  -1 
criteria in the iif statement? 

The second question I have is that with the first  expression put in the 
source for display I am getting Name instead of the Y value for matching 
condition. I would appreciate any help. Thanks.
0
Utf
11/2/2007 3:51:02 PM
access.forms 6864 articles. 2 followers. Follow

3 Replies
1796 Views

Similar Articles

[PageSpeed] 52

You need a nested IIf statement:

=iif([dbo_PWO_Status].[Quote] = -1, IIf((DateDiff("d",[dbo_PWO_Status].
[WorkOrderDate],Now())-180)>0,"Y",""), "") 





Jack wrote:
>Hi,
>I have a form where I have to display the value of the field based on some 
>criteria. 
>The first criteria is 
>
>=IIf((DateDiff("d",[dbo_PWO_Status].[WorkOrderDate],Now())-180)>0,"Y","") 
>and the second criteria to add is 
>
>dbo_PWO_Status.[Quote] =  -1
>
>My first question is how do I accommodate the dbo_PWO_Status.[Quote] =  -1 
>criteria in the iif statement? 
>
>The second question I have is that with the first  expression put in the 
>source for display I am getting Name instead of the Y value for matching 
>condition. I would appreciate any help. Thanks.

-- 
Message posted via http://www.accessmonster.com

0
benyod79
11/2/2007 4:01:22 PM
Make sure you're referencing the correct field names.


Jack wrote:
>Hi,
>I have a form where I have to display the value of the field based on some 
>criteria. 
>The first criteria is 
>
>=IIf((DateDiff("d",[dbo_PWO_Status].[WorkOrderDate],Now())-180)>0,"Y","") 
>and the second criteria to add is 
>
>dbo_PWO_Status.[Quote] =  -1
>
>My first question is how do I accommodate the dbo_PWO_Status.[Quote] =  -1 
>criteria in the iif statement? 
>
>The second question I have is that with the first  expression put in the 
>source for display I am getting Name instead of the Y value for matching 
>condition. I would appreciate any help. Thanks.

-- 
Message posted via http://www.accessmonster.com

0
benyod79
11/2/2007 4:03:03 PM
Thanks for your help. I appreciate it. Regards

"benyod79 via AccessMonster.com" wrote:

> Make sure you're referencing the correct field names.
> 
> 
> Jack wrote:
> >Hi,
> >I have a form where I have to display the value of the field based on some 
> >criteria. 
> >The first criteria is 
> >
> >=IIf((DateDiff("d",[dbo_PWO_Status].[WorkOrderDate],Now())-180)>0,"Y","") 
> >and the second criteria to add is 
> >
> >dbo_PWO_Status.[Quote] =  -1
> >
> >My first question is how do I accommodate the dbo_PWO_Status.[Quote] =  -1 
> >criteria in the iif statement? 
> >
> >The second question I have is that with the first  expression put in the 
> >source for display I am getting Name instead of the Y value for matching 
> >condition. I would appreciate any help. Thanks.
> 
> -- 
> Message posted via http://www.accessmonster.com
> 
> 
0
Utf
11/2/2007 7:40:02 PM
Reply:

Similar Artilces:

Help with problem
I accidentally clicked on the "From" field in Outlook and drug it down my listing of emails. Now the field is missing and my emails do not list who they are from on the screen. I have to click on the email to see who it is from now. I cannot figure out how to get that field back now that I have done this. I have looked in a few places in Outlook to see if I could figure it out, but to no avail I have not figured it out. Any help would be appreciated. Right-click on the bar and add it back, or choose Customize Current View. Choose Fields, add the From field back. ...

Outlook express auto-reply fiasco!
HI- not sure if anyone can help me- I've got a maddening situation. I'm trying to set an auto-reply for someoen who's going on a trip, and rather than replying to all new incoming messages, it's sending auto responses to EVERYONE in the inbox(there are over a thousand messages)! luckily the bulk of the messages were caught and deleted while still in the outgoing mailbox and did not get sent, but why is this happening? These are the rules i'm following: In the Tools menu choose Message Rules. In the Message Rules dialog box, choose Mail. In Box #1 select the last c...

OWA Attachments problems
(BACKGROUND info - 2003 Front End(DMZ) - 1 2003 Backend - 2 2000 Backend - McAfee Groupshield 6.0 on each server) We're experiencing problems attaching attachments to our front-end mailserver via OWA. Small files < 1MB generally have no problems. If we connect directly to the server which the mailbox resides we have no problems.. This problem is internal and external. Problem occurs whether or not your mailbox is on the 2003 backend or 2000 backends. Thank you, Anthony Graber This sounds like the public folder posting limit. Are you trying to post to a PubliC Folder: http:/...

SP3 Install Problems
I have copied SP3 to a cd-r and then went to the pos computer running Store Ops (no online access) to install SP3. I got an error message Looking for another CD. Can SP3 be copied to a system from a cd. chucky8822, It might be looking for the original MRMS install disk. Try copying the Microsoft Retail Management System Store Operations.msi file to the disk if you only have Store Operations installed on this machine. If you have HQ, copy the 2 .msi files from the HQ disk too. -- * "chucky8822" <chucky8822@discussions.microsoft.com> wrote in message news:A577019E-BF7F-...

initial post on possible problem with csv files
I don't have all the info yet but before I spend any time on this is there any known issues with Excel 2002 sp2 opening .csv files incorrectly? I have a report of a csv file opening fine in excel 97 but the same file is not formatted correctly when opened in Excel 2002 sp2... apparently all data gets stuffed into one column instead of it correctly separating columns according to the comma delimited file. any info would be greatly appreciated.. thanks. Maybe it's not excel that's really at fault. You may want to look at your regional settings and make sure that the separator in...

Final Problems
Alright. Getting closer and closer to the full instal of CRM onto our network, and there are only two hurdles left. The first error message I am getting, during the install, states "The specified domain either does not exist or could not be contacted.". The second error, agian during the install, "Setup cannot connect to the Microsoft CRM server. This might indicate that the server is down." Any helpful hints to get this thing fully installed? thanks, Chris Hi Chris, I am assuming that you are installing the CRM outlook client. you might already look into this but ju...

Chart problem.
I have a chart that plots body mass index, ie value on y axis, and dates on x axis. I have also added a second category x as I have divided the chart into horizonatl zones with different colors (ie underweight, overweight etc). Things work fine except that when I plot, for instance, three dates (Jan 1, Feb 1, March 1). The Jan point is right on the left side Y axis, the Feb is mid way across the chart, and the March is on the other end of the chart (right Y axis) I'd like to narrow down the spaces between each data point, and also have some space at the beginning of the chart ...

removing locked cost field from product form
On the Product entity form the 3 fields 'list price' 'standard cost' and 'current cost' are locked. Is there a way to get the 'current cost' field off the form so it can't be seen by users? thanks Garnet Hi Garnet, You can use the following Javascript Onload of the form: crmForm.all.<<name of the field>>_d.style.display = "none"; HTH, Niths "Garnet" wrote: > On the Product entity form the 3 fields 'list price' 'standard cost' and > 'current cost' are locked. Is there a way to get the &#...

problem erasing CD-RW disc
Hello, I need to erase a CD-RW I use the follwing code: http://social.msdn.microsoft.com/Forums/en-US/windowsopticalplatform/thread/709d5658-6581-4dbc-8357-778cf052afe9 But I get this error: 0xC0AA090B E_IMAPI_ERASE_CLIENT_NAME_IS_NOT_VALID This obviously means: "The client name is not valid" http://msdn.microsoft.com/en-us/library/cc835244(VS.85).aspx But what is "The client" ? And what may cause this error? How could I use VBS to erase a RW CD or DVD? I use XP SP2 Thank you ...

Cannot save Passwords problem
Hello. Having problems with saved passwords. Outlook 2003 and IE8 wouldn't save passwords. I have tried the following without success: kb en us 290684 Reverting to IE7 I loaded Google Chrome and it wont save either. Any further ideas? Would creating a new user be an option? Thanks ...

Report Problem
-- Hansford D. Cornett ...

Print to custom Forms offline
Does anyone know how to or if there is a third paty software that allows you to print to a customized form while offline with the laptop client? Please let me know thanks. Dan white wrote: > Does anyone know how to or if there is a third paty software that allows you > to print to a customized form while offline with the laptop client? > > Please let me know thanks. i think that you could do a mail merge using your local sql offline db. You would need to crete a new ODBC connection through administrative tools that connects to your local db and then create a new mail merge .d...

Problems again
When iI finshed last night, Money 2005 was working fine. Went to it tonight to update accounts - no longer can do so, again. Go to manage online banking - again, TD Canada Trust and BMO are not listed. Go to the "See the financial institions Money Supports" and both are listed. I just cannot get them into the list on my program. How do I do it? Barry ...

VPC- Customization export problem
Hi, I'm trying to export customizations of CRM 4.0 (using the MS VPC image) to a stand alone system (onpremise). Export is failing with a message stating the language conversion failed and it says 1031, 1036, and 3082 are not supported on the production machine. VPC has German language pack and in the Settings -> Languages section three languages were enabled. Disabled those languages and did a fresh export, still no use. Any help would be greatly appreciated. Keshav On 18 d=E9c, 22:42, keshav...@gmail.com wrote: > Hi, > > I'm trying to export customizations of CRM 4.0...

Question re: Outlook & Outlook Express
I use Outlook for all my emails & Outlook Express for news groups. Each has a different email address. When I "Reply to Group" in Outlook Express, no problem. When I select "Reply", I am prompted for an Outlook profile ( I have two) which, as I understand it, will cause the message to be sent with the Outlook profile and its corresponding email address that I select. Do I need to create a profile or email account or both in Outlook Express or add a profile to Outlook? Either way it would be a different email address than the two in Outlook. I must use a different ...

WM_PAINT problem
Hi I have this function for my dialog box (it's a project based on dialog box): void CDialogBarCopy::OnPaint() { CPaintDC dc(this); // device context for painting dc.SetBkColor(RGB(212,208,200)); dc.SetTextColor(RGB(255,0,0)); CFont *m_Font1 = new CFont; m_Font1->CreatePointFont(260, "Garamond"); dc.SelectObject(m_Font1); if(LecteurEnd == 1) { dc.TextOut(19, 37, "test"); } } If I delete the if condition "if(LecteurEnd == 1)", this code work good, but I want to do it just when my variable "LecteurEnd" is set to 1. When I set the varia...

How to solve this problem? #2
I write two program,one is that create ODBC-link to access and register two control:MS ADO Data and MS DataGrid automaticly,another is to display database,look: BOOL CAutoDlg::OnInitDialog() { SQLConfigDataSource(NULL,ODBC_ADD_DSN,"Microsoft Access Driver (*.mdb)\0", \ "DSN=LeadLink\0 DESCRIPTION=For Lead ODBC Link\0 DBQ=RS485.mdb\0 FIL=Microsoft \ Access\0 default="); CString OcxFileName; HINSTANCE hLib; FARPROC lpDllEntryPoint; OcxFileName="MSADODC.OCX"; hLib = LoadLibrary(OcxFileName); if (hLib==NULL) { AfxMessageBox("Error"); } lpDllEntryPo...

Two-Column problem
Using Arrange, Layout Guides, I set up Publisher 2002 with two columns per page and with two master pages with mirrored guides. For the first 11 pages, text flowed as expected. That is, each new pair of pages had two textboxes per page. But now, when I add a pair of pages, Publisher gives me guides for two columns per page but gives me only one page-wide textbox per page, not two. How do I force Publisher to give me two textboxes per page, as it did for the first 11 pages? (I might be missing something obvious. I haven't used Publisher in several years.) Thanks. Charley After mana...

Problem: Email Body becomes attachment in Text-only email client
We recently noticed CRM emails read via our University's web-based, text-only email client have the message body show up as an "unknown" attachment. This requires the student to open this attachment to read the email. It didn't always work this way, so I am trying to figure out if this is related to the upgrade from version 3 to 4 of CRM, a later rollup, or an "upgrade" to the University's text-only web-based email client? The email is viewable just fine is email client's that support html rendering. Anyone else seen this before? Any ideas on how ...

CWinapp::onExitInstance
this is about using a dll i have made in another language. called from a MFC dll that has an instance of CwinApp i have a dll i programemd in delphi.. it uses indyTcp server, it has exported DLL methods to starting, and stopping the server which including freeing classes etc, sets TCpserver.active to true and false i am calling this dll from microsoft visual C++ (using loadlibrary, get procaddress) this is working fine, i can turn on the server, it behaves how i want, and i can turn it off. and everything gets unloaded from memory fine, if i call the turnoffserver methods in the delphi dll d...

Problems with merged cells
I have merged a fair few cells so that I can enter paragraphs, once I type past a certain point it wont bring up everything I have entered in the cell, it cuts half of it off & it wont print it either, but when i click on the cell all the information is there......can anyone help me out with this??? Excel has limitations (see link below). Cells will show up to 1024 characters, but up to 32,767 will appear in the formula bar. Printing.. maybe it has a 1024 character limit too. (Just because you're using merged cells doesn't mean you get more characters - they're ...

Problem with Filegroups and Indexes
Hi all I have two filegroups (DATA and INDEX). I create a new table on filegroup DATA and a PrimaryKey Constraint (NONCLUSTERED) on filegroup INDEX. This works fine, the table is on filegroup DATA and the Index on filegroup INDEX. When I now add a clustered Index (to filegroup INDEX), the filegroup of the table is changed to INDEX ... Does somebody know why this happens ?? Thanks a lot and best regards Frank Uray Hi Frank The leaf level of a clustered index IS the data. You cannot have a clustered index separate from the data, so wherever you build the clustered inde...

Problems with Upsize Wizard
I'm trying to upsize a table from Access 2002 to SQL Server 2000 using the Upsize Wizard in Access. I keep getting the following unhelpful error message : Table was skipped or export failed. The weird part is that I can use the Export utility to create the table on the SQL Server and it works perfectly. It creates the new table complete with indexes and data. This also tells me that the DSN I'm using for both the Export and the Upsize Wizard is set up properly, otherwise the export wouldn't have worked. The table is also just a standard, no-nonsense test table I created. It has ...

Linking problem
Hi, when i try to compile my project i get the following error: LINK : fatal error LNK1104: cannot open file "dsprop.lib" Where is this file? What should i do? Regards Emmanuel Emmanuel, > LINK : fatal error LNK1104: cannot open file "dsprop.lib" > > Where is this file? What should i do? You need to update your platform sdk. http://www.microsoft.com/msdownload/platformsdk/setuplauncher.asp -- Regards, Kobi Ben Tzvi "Emmanuel" <e951753@hotmail.com> wrote in message news:090101c37874$9fcc1f40$a301280a@phx.gbl... > > Hi, >...

Word File Problems
When someone sends me an e-mail with a word document attached to it..Microsoft Office Vx does not seem to recognize certain characters...such as 1/2...it formats it as a leading -. For instance..... terms are 1/2 May and 1/2 June When I open the doc it looks like - May and - June. What can I do to rectify this? Thks, Art In article <f568d118.0402041736.3d32b81e@posting.google.com>, ademers254@mac.com (Art Demers) wrote: > When someone sends me an e-mail with a word document attached to > it..Microsoft Office Vx does not seem to recognize certain > characters...such as 1/2...