Help with this IF, Else, Else If and End If problem? ASP/VB
Hoping someone can help me with this. I have three database
tables,
orderdetails, paidorders, ordercomplete and the following
recordset:
<%
Dim rsOrderSearch
Dim rsOrderSearch_cmd
Dim rsOrderSearch_numRows
Set rsOrderSearch_cmd = Server.CreateObject ("ADODB.Command")
rsOrderSearch_cmd.ActiveConnection = MM_connNAME_STRING
rsOrderSearch_cmd.CommandText = "SELECT orderID, (SELECT
COUNT(*) FROM
dbo.tblpaidorders WHERE dbo.qryorderdetails.orderID =
dbo.tblpaidorders.orderID) AS PAIDORDER, (SELECT COUNT(*)
FROM
dbo.tblordercomplete WHERE dbo.qryorderdetails.orderID =
dbo.tblordercomplete.orderID) AS COMPLETEORDER,
itemdescription FROM
dbo.qryorderdetails WHERE orderID = ? OR customerID = ? OR
itemdescription
LIKE ? ORDER BY orderdate DESC"
rsOrderSearch_cmd.Prepared = true
rsOrderSearch_cmd.Parameters.Append
rsOrderSearch_cmd.CreateParameter("param1", 5, 1, -1,
rsOrderSearch__MMColParam) ' adDouble
rsOrderSearch_cmd.Parameters.Append
rsOrderSearch_cmd.CreateParameter("param2", 5, 1, -1,
rsOrderSearch__MMColParam1) ' adDouble
rsOrderSearch_cmd.Parameters.Append
rsOrderSearch_cmd.CreateParameter("param3", 200, 1, 255, "%"
+
rsOrderSearch__MMColParam2 + "%") ' adVarChar
Set rsOrderSearch = rsOrderSearch_cmd.Execute
rsOrderSearch_numRows = 0
%>
If the orderID appears in the ordercomplete table (thus
COMPLETEORDER would
have a COUNT value of 1), I want to display "Completed".
If the orderID appears in the paidorders table (thus
PAIDORDER would have a
COUNT value of 1), I want to display "Awaiting
Pickup/Delivery".
For everything else, I want to display "Open Job".
For some reason, the following doesn't display the "Awaiting
Pickup/Delivery" option, but seems to be displaying
"Completed" correctly.
I've tried various combinations, but it looks correct to me!
Is it?:
<%IF (rsOrderSearch.Fields.Item("COMPLETEORDER").Value)
> 0 Then%>
<span class="greentext">Completed</span>
<%Else%>
<%IF (rsOrderSearch.Fields.Item("PAIDORDER").Value) > 0
Then%>
<span class="orangetext">Awaiting
Pickup/Delivery</span>
<%Else%>
<span class="redtext">Open Job</span>
<%End If%>
<%End If%>
Also, the above code is in a table cell within a repeat
region. If I move
this to a different table cell within the same repeat region,
it doesn't
display at all! This seems more like a bug to be honest, but
considering
the above code doesn't work, I'm wondering if that is the
reason?
If anyone can help, I'd really appreciate it. Thanks.
Regards
Nath.
Hi,
Relating this to my other more recent post about the crash
when udpating
site cache, do you think that this:
<%IF (rsOrderSearch.Fields.Item("COMPLETEORDER").Value)
> 0 Then%>
<span class="greentext">Completed</span>
<%Else%>
<%IF (rsOrderSearch.Fields.Item("PAIDORDER").Value) > 0
Then%>
<span class="orangetext">Awaiting
Pickup/Delivery</span>
<%Else%>
<span class="redtext">Open Job</span>
<%End If%>
<%End If%>
...would be sufficient to corrupt my site, or site cache (or
whatever it
is!)? I had suspected my own personalisation of DW's
MM_Username to
MM_Username1 was causing the problem but, having just spent
an hour editing
every file within the sub-directory that is causing the
problems, in Notepad
(because DW crashes when I open them), and renaming my
MM_Username1 back to
MM_Username, I notice that DW is still crashing. So I have
ruled out the
MM_Username because this had been working fine anyway, up to
yesterday.
So...the only other thing I've done on the site is to add
this:
<%IF (rsOrderSearch.Fields.Item("COMPLETEORDER").Value)
> 0 Then%>
<span class="greentext">Completed</span>
<%Else%>
<%IF (rsOrderSearch.Fields.Item("PAIDORDER").Value) > 0
Then%>
<span class="orangetext">Awaiting
Pickup/Delivery</span>
<%Else%>
<span class="redtext">Open Job</span>
<%End If%>
<%End If%>
Would this crash my site cache? I'm really at a loss as to
what has
happened.
Can you have two COUNT(*) .... AS suchandsuch in one SELECT
statement? I
wondered if that was maybe it.
Would appreciate your help because, as it stands, I can't
open this
sub-directory in DW.
Thanks
Nath.
"Lionstone" <[email protected]> wrote in
message
news:[email protected]...
> It's not DW - it's ADO. TEXT/NTEXT are handled one way,
and all other
> types are handled another. It has to do with when and
how the data is
> retrieved, and the details are headache-inducing.
>
>
> Using a client-side cursor would also work since the
data is all
> retrieved, not retrieved as needed.
> "tradmusic.com" <[email protected]> wrote
in message
> news:[email protected]...
>> Hi,
>>
>> I'm hoping there's nothing wrong with my logic, but
I think I've spotted
>> the problem!
>>
>> Within that recordset, there is a field called
"deliverdetails". This is
>> an ntext field in my database.
>> Because this doesn't appear as the last field in the
list of fields in
>> the statement it causes "weird" things to happen.
>> I removed the reference to this field, and it's all
working!
>>
>> Sometimes I really don't understand why it would
cause other fields to
>> fail, or not function properly, but ntext fields are
just not handled
>> very well by DW 8.0.2. Groan.
>>
>> Thanks anyway Pizza.
>> Nath.
>>
>> "PizzaGood" <[email protected]> wrote in
message
>> news:[email protected]...
>>>I think the problem has to do with your logic.
>>>
>>> Can you give us some examples of the values for
a record, specifically
>>> the values for
>>>
>>> - COMPLETEORDER
>>> - PAIDORDER
>>>
>>> Like:
>>>
>>> - a paid order looks like this:
>>> - a complete order looks like this:
>>>
>>>
>>>
>>>
>>> "tradmusic.com"
<[email protected]> wrote in message
>>> news:[email protected]...
>>>> Hoping someone can help me with this. I have
three database tables,
>>>> orderdetails, paidorders, ordercomplete and
the following recordset:
>>>>
>>>> <%
>>>> Dim rsOrderSearch
>>>> Dim rsOrderSearch_cmd
>>>> Dim rsOrderSearch_numRows
>>>>
>>>> Set rsOrderSearch_cmd = Server.CreateObject
("ADODB.Command")
>>>> rsOrderSearch_cmd.ActiveConnection =
MM_connNAME_STRING
>>>> rsOrderSearch_cmd.CommandText = "SELECT
orderID, (SELECT COUNT(*) FROM
>>>> dbo.tblpaidorders WHERE
dbo.qryorderdetails.orderID =
>>>> dbo.tblpaidorders.orderID) AS PAIDORDER,
(SELECT COUNT(*) FROM
>>>> dbo.tblordercomplete WHERE
dbo.qryorderdetails.orderID =
>>>> dbo.tblordercomplete.orderID) AS
COMPLETEORDER, itemdescription FROM
>>>> dbo.qryorderdetails WHERE orderID = ? OR
customerID = ? OR
>>>> itemdescription LIKE ? ORDER BY orderdate
DESC"
>>>> rsOrderSearch_cmd.Prepared = true
>>>> rsOrderSearch_cmd.Parameters.Append
>>>> rsOrderSearch_cmd.CreateParameter("param1",
5, 1, -1,
>>>> rsOrderSearch__MMColParam) ' adDouble
>>>> rsOrderSearch_cmd.Parameters.Append
>>>> rsOrderSearch_cmd.CreateParameter("param2",
5, 1, -1,
>>>> rsOrderSearch__MMColParam1) ' adDouble
>>>> rsOrderSearch_cmd.Parameters.Append
>>>> rsOrderSearch_cmd.CreateParameter("param3",
200, 1, 255, "%" +
>>>> rsOrderSearch__MMColParam2 + "%") '
adVarChar
>>>>
>>>> Set rsOrderSearch =
rsOrderSearch_cmd.Execute
>>>> rsOrderSearch_numRows = 0
>>>> %>
>>>>
>>>> If the orderID appears in the ordercomplete
table (thus COMPLETEORDER
>>>> would have a COUNT value of 1), I want to
display "Completed".
>>>> If the orderID appears in the paidorders
table (thus PAIDORDER would
>>>> have a COUNT value of 1), I want to display
"Awaiting Pickup/Delivery".
>>>> For everything else, I want to display "Open
Job".
>>>>
>>>> For some reason, the following doesn't
display the "Awaiting
>>>> Pickup/Delivery" option, but seems to be
displaying "Completed"
>>>> correctly.
>>>> I've tried various combinations, but it
looks correct to me! Is it?:
>>>>
>>>> <%IF
(rsOrderSearch.Fields.Item("COMPLETEORDER").Value) > 0 Then%>
>>>> <span
class="greentext">Completed</span>
>>>> <%Else%>
>>>> <%IF
(rsOrderSearch.Fields.Item("PAIDORDER").Value) > 0 Then%>
>>>> <span class="orangetext">Awaiting
Pickup/Delivery</span>
>>>> <%Else%>
>>>> <span class="redtext">Open
Job</span>
>>>> <%End If%>
>>>> <%End If%>
>>>>
>>>> Also, the above code is in a table cell
within a repeat region. If I
>>>> move this to a different table cell within
the same repeat region, it
>>>> doesn't display at all! This seems more like
a bug to be honest, but
>>>> considering the above code doesn't work, I'm
wondering if that is the
>>>> reason?
>>>>
>>>> If anyone can help, I'd really appreciate
it. Thanks.
>>>> Regards
>>>> Nath.
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>
Similar Messages
-
Help with this ... using drag and drop
Hi guys,
I'm an intermediate user of Flash, but I'm stuck ... I'm
trying to see if I can recreate this page in Flash for a friend
(it's an awful site!):
Mannequin
There are two ways I thought I could do this ... as they've
done it, you cycle through the items, click on an item and it will
appear in a hierarchy on the mannequin ... or as I've tried to
attempt it, by dragging the item onto the mannequin.
This is EXTREMELY rough as I just wanted to see if it could
be done before designing it all, so it's stick men I'm afraid! I've
got two movieclips on the stage, one is the console and one is the
mannequin. The console contains items of clothing which are each
movieclips placed in their own frame, back and forward buttons and
an add button (ignore that button).
I've managed to set it up so that the item of clothing
duplicates and you can drag it onto the mannequin. I have two
problems ... the mannequin goes back to normal when I go through
the items in the console and the items in the console appear on top
of each other as you flick through (probably because of the
duplicatemovie command).
I want to be able to drag each item, establish a hierarchy on
the mannequin (e.g. so a jacket will go over a top) ... I've
searched this forum for drag and drop info and have seen references
to specifying a target, but I'm stuck. I've got a feeling I'm on
the right lines, but I've either laid it out wrong on the stage or
I'm missing a vital piece of actionscript ... Please can anyone
advise??? Thanks
Test Mannequin
Flash FileHi,
It would help if you could give some more details:
- what are you trying to do (drag and drop a whole component, drag an item within a tree, or a table, drag an item from one component to another?)
- have you found the modules you need in the unbound modules?
- have you read the documentation about the drag and drop actions? can you say which parts you're having problems with? The documentation is here. You'll have to select the component you are interested in and locate the action "drag" and the action "drop" to read about the parameters required.
Best regards,
Alex -
I need advise and help with this problem .
First , I have been with Mac for many years ( 14 to be exact ) I do have some knowledge and understanding of Apple product .
At the present time I'm having lots of problems with the router so I was looking in to some info , and come across one web site regarding : port forwarding , IP addresses .
In my frustration , amongst lots of open web pages tutorials and other useless information , I come across innocent looking link and software to installed called Genieo , which suppose to help with any router .
Software ask for permission to install , and about 30 % in , my instinct was telling me , there is something not right . I stop installation . Delete everything , look for any
trace in Spotlight , Library . Nothing could be find .
Now , every time I open Safari , Firefox or Chrome , it will open in my home page , but when I start looking for something in steed of Google page , there is
''search.genieo.com'' page acting like a Google . I try again to get raid of this but I can not find solution .
With more research , again using genieo.com search eng. there is lots of articles and warnings . From that I learn do not use uninstall software , because doing this will install more things where it come from.
I do have AppleCare support but its to late to phone them , so maybe there some people with knowledge , how to get this of my computer
Any help is welcome , English is my learned language , you may notice this , so I'm not that quick with the respondGenieo definitely doesn't help with your router. It's just adware, and has no benefit to you at all. They scammed you so that they could display their ads on your computer.
To remove it, see:
http://www.thesafemac.com/arg-genieo/
Do not use the Genieo uninstaller! -
My iPod touch was stolen and recovered. I can use my Apple id for this site but the theif changed the Apple id needed to update apps etc and I do not know how to delete his acct. Any help with this will be greatly appreciate
If the thief enabled activation lock on the device, then there is nothing that can be done. Only the password for the Apple ID that it is locked with can disable activation lock.
-
Hi can anyone help with this issue regarding my wireless magic mouse? When im on google chrome and scrolling down the page i always have youtube running in the background but the audio cuts/spits/pops can anyone help me with this?
The figures you mention only make sense on your intranet. Are you still using the same wireless router. The verizon one is somewhat limited as far as max wireless-n performace. For one thing it only has a 2.4 radio. I like many people who wanted wireless-n performance before they even added a wireless-n gigabit router, have my own handling my wireless-n network.
-
I'm using my iPod and an Epson XP-810 printer to print pages from websites and emails and etc.
How do I print just 1 page out of 14 pages .
I don't see any settings on my iPod and can't find settings on the printer .
Can someone help with this problemGoogle show that you have to cut what you want to print and then paste it into a new app and print from that app.
http://www.ipadforums.net/new-member-introductions-site-assistance/63145-printin g-one-page-ipad-2-a.html -
I need to use my iMac to run some Windows software not available for Mac and was thinking of obtaining Parrallels Desktop 9 to help with this. If I use Parrallels do you still have to partitian your drive and does this leave you open to viruses?
You do not have to partition your drive - Parallels creates a disk image which contains your Windows installation. You do have to exercise anti-virus measures in the Windows partition, although such malware cannot affect the Mac filesystem.
Matt -
My iphone 5 is not syncing with my laptop and windows 8. cant find an itunes app for my laptop. is there something i can get that will help with this?
Lbo51380 wrote:
cant find an itunes app for my laptop. is there something i can get that will help with this?
Go here -> http://www.apple.com/itunes/download/ -
I downloaded the icloud software on my computer in order to sync calenders and contacts using Windows 2007, but I keep getting an error message when trying to sync my icloud and Outlook calendars. I downloaded it for the first time a month ago and had it working but it stopped syncing, so I deinstalled the iCloud software and reinstalled, but keep getting the error message "Your setup couldn't be started because of an unexpected error. What do I do now? Can anyone help with this?
Hello easbda,
Thank you for providing the details of the calendar issue you are experiencing with your iPhone. I recommend following the steps in the section titled "Troubleshooting on Microsoft Windows (Microsoft Outlook)" in the following article to assist with syncing your calendar events between your devices:
iCloud: Troubleshooting iCloud Calendar
http://support.apple.com/kb/ts3999
Thank you for using Apple Support Communities.
Best,
Sheila M. -
When I tap the Apple store, YouTube and the iTunes apps, they don' launch. Any help with this?
1. Double-click the Home button to close all Inactive Apps in Task Bar
2. Hold the Apps in Task Bar down for a second or two until you see the minus sign
3. Tap the minus sign to close App
4. Tap center of screen to return to Home Screen
5. Reset iPad. Hold the Sleep and Home button down for about 10 second until you see the Apple logo. Ignore the red slider -
I purchased Adobe Acrobat x Pro recently and installed it, I have compatibility issues vision 2013. The adobe pdf converter plug in stays inactive despite all my efforts to activate it, I need help with this? How can i get the plug in to work with Visio 2013?
For MS Visio (any version) only the appropriate version of Acrobat *PRO* provides PDFMaker for Visio.
For Visio 2013 specifically you must have Acrobat XI Pro (updated to at least 11.0.1).
See:
http://helpx.adobe.com/acrobat/kb/compatible-web-browsers-pdfmaker-applications.html
Be well... -
I purchased Adobe Acrobat x Pro recently and installed it, I have compatibility issues vision 2013. The adobe pdf converter plug in stays inactive despite all my efforts to activate it, I need help with this? How can i get the plug in to work with Visio 2013?
For MS Visio (any version) only the appropriate version of Acrobat *PRO* provides PDFMaker for Visio.
For Visio 2013 specifically you must have Acrobat XI Pro (updated to at least 11.0.1).
See:
http://helpx.adobe.com/acrobat/kb/compatible-web-browsers-pdfmaker-applications.html
Be well... -
Hello anyone with Windows 7, not sure why having followed instructions above, install of latest version of itunes won't work and can no longer open old version either. anyone help with this?
Hi,
thanks for your reply.
Yes, except n°1 - empty Temp directory, I had tried/checked all of those.
I emptied the local temp folder tonight, but it still won't work.
Please note: the installation doesn't give me any problem. The program was working fine, until at one point *plouf* it stopped working. I can re-install it without any problem, it just crashes when opening.
\\edit\\ I seem to have located the problem, it's in the library files. If I re-install iTunes without my library, it works fine (though there is no music in it, yet). As soon as I import my library, or replace the My Music\iTunes folder with the old one, it stops working. -
Please help! I am trying to change my Apple Id that used to be my mother to Mine- Every time i have it changed and i go and try and do an update it continues to ask for her old password. I really need help with this!
Phil0124 wrote:
Apps downloaded with an Apple ID are forever tied to that Apple ID and will always require it to update.
The only way around this is to delete the apps that require the other Apple ID and download them again with yours.
Or simply log out of iTunes & App stores then log in with updated AppleID. -
Whenever I try to enter my credit card information into iTunes via either my mac book or my iphone it says there is an error and says "for assistance, please contact itunes support, etc...". Can anyone help with this?
I haven't had any luck at all getting it resolved using iTunes support so I'm hoping someone who's encountered the problem can help me.What did itunes suport tell you?
They will need to solve this. -
I recently updated my computer to 10.6 and now I can't get my printer MX340 (canon ) to work. I have installed the new drivers both from Canon's website and from an earlier post directly from apples website. I would surely appreciate some help with this.
Try what Terence Devlin posted in this topic:
Terence Devlin
Apr 14, 2015 11:21 AM
Re: Is Iphoto gone ? i want it back!
in response to Johannes666
Recommended
Go to the App Store and check out the Purchases List. If iPhoto is there then it will be v9.6.1
If it is there, then drag your existing iPhoto app (not the library, just the app) to the trash
Install the App from the App Store.
Sometimes iPhoto is not visible on the Purchases List. it may be hidden. See this article for details on how to unhide it.
http://support.apple.com/kb/HT4928
One question often asked: Will I lose my Photos if I reinstall?
iPhoto the application and the iPhoto Library are two different parts of the iPhoto programme. So, reinstalling the app should not affect the Library. BUT you should always have a back up before doing this kind of work. Always.
Maybe you are looking for
-
Dark bands or 'spotlights' on bottom of Macbook (early 2009) screen?
I have had my 13" Macbook since 2009. It's never given me an issue but yesterday I opened up my computer from sleep mode and there were dark bands across the bottom in between what looked like small spotlights beaming towards the top of the screen (t
-
My Late 2008 MBP has a strange problem today: when pressing power button, it took a long time (about 5-8 seconds) to respond, and it beeps 9 times (3 short, 3 long , then 3 short) along with the white LED at the front of the machine blinks. After tha
-
Keyboard creating loud fan noise after coffee spill
After a coffee spill my keyboard has been creating my fans to run very loudly. The temp. is still pretty normal at 40C. When I have the computer on and disconnect the keyboard, the fans return to normal. I've tried cleaning everything inside and r
-
Any possible dual presentation screen solution (Impress!ve+Writer)?
Hello. I've made a presentation in LaTeX-Beamer and want to use Impress!ve to project it to the projector or the Smart Board (some kind of projector) via an VGA cable, how can I have a dual screen so I can view some notes from OpenOffice Writer on my
-
Hi , I got an error in GB Payroll - Under 'Gross Payment [time management, function - PIT , PCR - G013 , /001 Valuation basis 1 I am getting an error , which says- Division by Zero not performed - Do any one have any idea why the PCR is broken half