Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

IIF statement issue VB.net

Posted on 2004-10-02
3
Medium Priority
?
929 Views
Last Modified: 2006-11-17
hi experts, i am having an issue with using the IIF statement to an access db from my vb.net application
here is my code and the error i get.
this one really has me stumped as far as i can tell my syntax is correct.
i have tried simple iif statements and they all fail on the '<=>' argument

SELECT IIf(A.ASSIGN_DT>A.EXP_DT,DateDiff('d',A.ASSIGN_DT,Now()),DateDiff('d',A.EXP_DT,Now())) AS AGE, A.CASE_ID, A.CASE_TYPE, A.INSURED, A.INS_DBA, A.ASSIGN_DT, A.EXP_DT, A.SENT_DT, A.REP_DUE_DT,
                      A.CASE_READ, A.CON_CITY, A.INS_PHONE, B.STAT_COMMENTS AS Scheduled, B.STATUS_DESC AS Description
FROM         (SELECT     dattbl_Case.CASE_ID, dattbl_Case.CASE_TYPE, dattbl_Case.INSURED, dattbl_Case.INS_DBA, dattbl_Case.ASSIGN_DT,
                                              dattbl_Case.REP_DUE_DT, dattbl_Case.EXP_DT, dattbl_Tracker.CASE_READ, dattbl_Tracker.SENT_DT, dattbl_Case.CON_CITY,
                                              dattbl_Case.INS_PHONE
                       FROM          dattbl_Case INNER JOIN
                                              dattbl_Tracker ON dattbl_Case.CASE_ID = dattbl_Tracker.CASE_ID
                       WHERE      (dattbl_Tracker.FOLDER = 'INBOX')) A LEFT OUTER JOIN
                          (SELECT     CASE_ID, STAT_CODE, STAT_COMMENTS, STAT_ID, STAT_NEXT_DT, STATUS_DESC
                            FROM          dattbl_Status
                            WHERE      (STAT_CODE = 78 OR
                                                   STAT_CODE = 79 OR
                                                   STAT_CODE = 80 OR
                                                   STAT_CODE = 81)) B ON A.CASE_ID = B.CASE_ID

Error in list of function arguments: '>' not recognized.
Unable to parse query text.
0
Comment
Question by:DTRON04
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 34

Accepted Solution

by:
flavo earned 2000 total points
ID: 12209790
hmmm.. not too sure but

Iif will return an object, and although your statement would have worked in VB 6.0 (id dare say) .Net is strongly typed and maybe this was the casue of the problem, so..

CType(IIf(A.ASSIGN_DT>A.EXP_DT,DateDiff('d',A.ASSIGN_DT,Now()),DateDiff('d',A.EXP_DT,Now())), Date)..

May also need to do it to cType(A.ASSIGN_DT,Date)>ctype(A.EXP_DT,date)

Dave
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
Traditionally, the method to display pictures in Access forms and reports is to first download them from URLs to a folder, record the path in a table and then let the form or report pull the pictures from that folder. But why not let Windows retr…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

604 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question