Returning a Card number
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums
Results 1 to 2 of 2

Thread: Returning a Card number

  1. #1
    Join Date
    Sep 2017

    Returning a Card number

    I am trying to write the formula to return a users medical card number for example on the system they are recorded as having a start date and end date.
    I want to able to display all values that are active as of the users admission date. so for example if user was admitted on
    01/01/2012 I want to display what medical card was active at that time/date. I have the following code so far but I am running into trouble.
    Also the end date may contain nulls. so it will always have a start date but not always a future end date.

    I have something like this so far but im probably way off

    and not isnull({USER_IDS.END_DTTM}) and {USER_IDS.END_DTTM}>=CurrentDate
    else 'No Medical Card'

    Any help be madly appreciated
    Crystal reports version 11.5.3

  2. #2
    Join Date
    Aug 2007

    Re: Returning a Card number

    I don't think there is enough info here to really provide an answer. First - what is the "trouble" you are running into? is there an error message, or is the output just not what is expected?

    My initial observation is you have four different criteria your are testing for, but only one result path. You may want to break this into logical chunks,
    if {USER_IDS.TYPE_REFNO}=1051 then
    	if {USER_IDS.STATUS_REFNO}=1542 then
    		if not isnull({USER_IDS.END_DTTM}) then
    			if {USER_IDS.END_DTTM}>=CurrentDate then
    				What to do if date is less than current date?
    			what to do if date is null
    		what to do if status_refno <> 1542
    	what to do if type_refno <> 1051

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Windows Mobile Development Center

Click Here to Expand Forum to Full Width

On-Demand Webinars (sponsored)