Ask a Question related to Coldfusion Database Access, Design and Development.

  1. #1

    Default Querey Issues

    I have a Querey that select patients based upon there appointment being two
    days ahead of today..which means it selects all patients appointment two days
    ahead..But when it is friday it will select patients for sunday but there are
    none, so it needs to select the patients for Monday...I was wondering how can i
    do this do i have to add another querey or should i just change the one i have
    to something eles........kinda lost

    <cfset ydate = DateFormat(DateAdd("d", +2, Now()), "MM/DD/YYYY")>
    <cfset tdate = DayOfWeek(Now())>

    <cfquery datasource="bashful_emoi" name="res">
    Select * From Patients where doc_code ='RA' and date_seen LIKE '%#ydate#'
    Order By last_name ASC
    </cfquery>






    <table border=0 cellspacing=0 cellpadding="4px" align="center">

    <tr>
    <td height="15px" background="topline.gif"
    class="lefttopbottom"><b><center>Name</center></b></td>
    <td height="15px" background="topline.gif"
    class="topbottom"><b><center>Appointment Date</center></b></td>
    <td height="15px" background="topline.gif"
    class="toprightbottom"><b><center>Provider</center></b></td>
    <td height="15px" background="topline.gif"
    class="toprightbottom"><b><center>Location</center></b></td>
    </tr>

    <cfoutput query="res">
    <tr>
    <td class="leftrightbottom">#res.last_name# , #res.first_name#</td>
    <td align="center" class="rightbottom">#res.date_seen#</td>
    <td aligm="center"
    class="rightbottom"><select><option></option><option>Ramig DPM , David
    L</option><option>Nicely DPM, Lisa</option><option>Greenberg DPM , Marc
    S</option></select></td>
    <td align="center" class="rightbottom"><input type="text" size="20"></td>
    </cfoutput>
    </table>







    </body>
    </html>
    :cool;:confused;

    PackinDaMAC Guest

  2. Similar Questions and Discussions

    1. FH 9 issues
      Can you add a border to a photo in FH9 once it's inserted into a project...or do you have to go back to the original in another app (FW 4) and add...
    2. [PHP-DEV] ZTS issues
      From: Michael Sisolak Here's the updated patch for that stuff http://www.ctindustries.net/patches/zts-php5-20031120.diff.txt Also fixes an...
    3. [PHP-DEV] ZTS issues
      > I have been looking at the IIS isapi issues and came up with the Rob, I've done some work in the past on ISAPI threading issues (although I...
    4. Issues with ER between IDS 9.30 UC5 and IDS 9.30 TC6
      There should not be any issues. hariog@yahoo.com (Hari Gupta) wrote in message news:<1a1cd35b.0310281500.6a03359f@posting.google.com>...
    5. XP PRO has WEP issues
      Kerby Krien wrote: Disable Wireless Zero Configuration service. Enter the WEP passcode and key cyphers manually. Q
  3. #2

    Default Querey Issues

    I have a Querey that select patients based upon there appointment being two
    days ahead of today..which means it selects all patients appointment two days
    ahead..But when it is friday it will select patients for sunday but there are
    none, so it needs to select the patients for Monday...I was wondering how can i
    do this do i have to add another querey or should i just change the one i have
    to something eles........kinda lost

    <cfset ydate = DateFormat(DateAdd("d", +2, Now()), "MM/DD/YYYY")>
    <cfset tdate = DayOfWeek(Now())>

    <cfquery datasource="bashful_emoi" name="res">
    Select * From Patients where doc_code ='RA' and date_seen LIKE '%#ydate#'
    Order By last_name ASC
    </cfquery>






    <table border=0 cellspacing=0 cellpadding="4px" align="center">

    <tr>
    <td height="15px" background="topline.gif"
    class="lefttopbottom"><b><center>Name</center></b></td>
    <td height="15px" background="topline.gif"
    class="topbottom"><b><center>Appointment Date</center></b></td>
    <td height="15px" background="topline.gif"
    class="toprightbottom"><b><center>Provider</center></b></td>
    <td height="15px" background="topline.gif"
    class="toprightbottom"><b><center>Location</center></b></td>
    </tr>

    <cfoutput query="res">
    <tr>
    <td class="leftrightbottom">#res.last_name# , #res.first_name#</td>
    <td align="center" class="rightbottom">#res.date_seen#</td>
    <td aligm="center"
    class="rightbottom"><select><option></option><option>Ramig DPM , David
    L</option><option>Nicely DPM, Lisa</option><option>Greenberg DPM , Marc
    S</option></select></td>
    <td align="center" class="rightbottom"><input type="text" size="20"></td>
    </cfoutput>
    </table>







    </body>
    </html>
    :cool;:confused;

    PackinDaMAC Guest

  4. #3

    Default Querey Issues

    I have a Querey that select patients based upon there appointment being two
    days ahead of today..which means it selects all patients appointment two days
    ahead..But when it is friday it will select patients for sunday but there are
    none, so it needs to select the patients for Monday...I was wondering how can i
    do this do i have to add another querey or should i just change the one i have
    to something eles........kinda lost

    <cfset ydate = DateFormat(DateAdd("d", +2, Now()), "MM/DD/YYYY")>
    <cfset tdate = DayOfWeek(Now())>

    <cfquery datasource="bashful_emoi" name="res">
    Select * From Patients where doc_code ='RA' and date_seen LIKE '%#ydate#'
    Order By last_name ASC
    </cfquery>






    <table border=0 cellspacing=0 cellpadding="4px" align="center">

    <tr>
    <td height="15px" background="topline.gif"
    class="lefttopbottom"><b><center>Name</center></b></td>
    <td height="15px" background="topline.gif"
    class="topbottom"><b><center>Appointment Date</center></b></td>
    <td height="15px" background="topline.gif"
    class="toprightbottom"><b><center>Provider</center></b></td>
    <td height="15px" background="topline.gif"
    class="toprightbottom"><b><center>Location</center></b></td>
    </tr>

    <cfoutput query="res">
    <tr>
    <td class="leftrightbottom">#res.last_name# , #res.first_name#</td>
    <td align="center" class="rightbottom">#res.date_seen#</td>
    <td aligm="center"
    class="rightbottom"><select><option></option><option>Ramig DPM , David
    L</option><option>Nicely DPM, Lisa</option><option>Greenberg DPM , Marc
    S</option></select></td>
    <td align="center" class="rightbottom"><input type="text" size="20"></td>
    </cfoutput>
    </table>







    </body>
    </html>
    :cool;:confused;

    PackinDaMAC Guest

  5. #4

    Default Re: Querey Issues

    You need to check to see if Now( ) + 2 is a Saturday or Sunday and set ydate
    accordingly. See below.

    <CFSET foo = DayOfWeek(Now())>
    <CFIF foo IS 1>
    <cfset ydate = DateFormat(DateAdd("d", +4 Now()), "MM/DD/YYYY")>
    <CFELSEIF foo IS 7>
    <cfset ydate = DateFormat(DateAdd("d", +3, Now()), "MM/DD/YYYY")>
    <CFELSE>
    <cfset ydate = DateFormat(DateAdd("d", +2, Now()), "MM/DD/YYYY")>
    </CFIF>

    jdeline Guest

  6. #5

    Default Re: Querey Issues

    I need to check and see if it is Sat Sun or Friday.....This should work right
    but it says i have an invalid cfml construct i dont know whyy thought....


    <cfset tdate = DayOfWeek(Now())>

    <cfif tdate IS 1>
    <cfset ydate = DateFormat(DateAdd("d", +2 Now()), "MM/DD/YYYY")> My error
    comes here
    <cfelseif tdate IS 7>
    <cfset ydate = DateFormat(DateAdd("d", +2 Now()), "MM/DD/YYYY")>
    <cfelseif tdate IS 6>
    <cfset ydate = DateFormat(DateAdd("d", +3 Now()), "MM/DD/YYYY")>
    <cfelse>
    <cfset ydate = DateFormat(DateAdd("d", +2, Now()), "MM/DD/YYYY")>
    </cfif>Text<cfset ydate = DateFormat(DateAdd("d", +2 Now()), "MM/DD/YYYY")>

    PackinDaMAC Guest

  7. #6

    Default Re: Querey Issues

    You are missing a comma after the 2
    <cfset ydate = DateFormat(DateAdd("d", +2 Now()), "MM/DD/YYYY")>
    Same problem on two others, also.
    jdeline Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139