Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - If Then Statement help
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

If Then Statement help

 Post Reply Post Reply
Author
photoshop_god View Drop Down
Newbie
Newbie
Avatar

Joined: 21 January 2004
Location: United States
Status: Offline
Points: 18
Post Options Post Options   Thanks (0) Thanks(0)   Quote photoshop_god Quote  Post ReplyReply Direct Link To This Post Topic: If Then Statement help
    Posted: 06 July 2004 at 2:15pm

Hi,

I have been looking at this statement trying to figure out why it is not working.  I hope that someone here can help me out.

This is the statement that I'm having trouble with:

<% If (intRecordCount = "0") Then%><b>It appears that both Gregory and Marty are available for your wedding date!</b><% ElseIf (intRecordCount = "1") Then%><b>It appears that one photographer is available for your wedding date!</b><% ElseIf (intRecordCount > "1") Then%><b>I'm Sorry. It appears that both photographers are booked for that day.  Please contact the studio at 608.222.2698 to confirm this information.</b><% Else %><b>See If Your Wedding Date Is Available!</b><% End If %>

What's going on is someone enters in a date and the code goes out to a database and counts the number of records returned and then displays the appropriate message.  Everything is working fine exept when you first load the page is displays the second to last message

<b>I'm Sorry. It appears that both photographers are booked for that day.  Please contact the studio at 608.222.2698 to confirm this information.</b>

instead of my default message of

<b>See If Your Wedding Date Is Available!</b>.

I works if I change

<% ElseIf (intRecordCount > "1") Then %>

to < .  But I need the exact opposite.  Am I missing something?  I have also tried >= with no luck.

I would appreciate any help.

Back to Top
dj air View Drop Down
Senior Member
Senior Member
Avatar

Joined: 05 April 2002
Location: United Kingdom
Status: Offline
Points: 3627
Post Options Post Options   Thanks (0) Thanks(0)   Quote dj air Quote  Post ReplyReply Direct Link To This Post Posted: 06 July 2004 at 2:24pm
here is the code, the above code is hard to read

<% If (intRecordCount = "0") Then%><b>It appears that both Gregory and Marty are available for your wedding date!</b>

<% ElseIf (intRecordCount = "1") Then%><b>It appears that one photographer is available for your wedding date!</b>

<% ElseIf (intRecordCount > "1") Then%><b>I'm Sorry. It appears that both photographers are booked for that day.  Please contact the studio at 608.222.2698 to confirm this information.</b>

<% Else  %><b>See If Your Wedding Date Is Available!</b><% End If %>

you could make it so that there is a verable like select = False

and if that is False then show the default message and it is set to true if the form has been submitted.

add a value to the form that when it is sent it sends a value as true and that value is checked before action is done
Back to Top
photoshop_god View Drop Down
Newbie
Newbie
Avatar

Joined: 21 January 2004
Location: United States
Status: Offline
Points: 18
Post Options Post Options   Thanks (0) Thanks(0)   Quote photoshop_god Quote  Post ReplyReply Direct Link To This Post Posted: 06 July 2004 at 2:29pm

Thanks dj air,

I just though of that after I posted.  I'm going to try it now.  Im sure this will solve my problem.  Thanks for the quick response.



Edited by photoshop_god
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.