?
Solved

Help with if then statment

Posted on 2006-11-28
2
Medium Priority
?
152 Views
Last Modified: 2010-04-25
I want to write an if then statement so that a record only displays if there is something in the entry other than "Select Month" and "Select Day" (the first selection in two drop down menus). I don't know the proper way to write this in code. Can someone take a look at what I've got and help me out? I'm using ASP VBScript. Thanks.

 <% If rsevents.monthto <> "Select Month" And rsevents.dayto <> "Select Day" Then %>
                    to <%=(rsevents.Fields.Item("monthto").Value)%>&nbsp;<%=(rsevents.Fields.Item("dayto").Value)%>
  <% End If ' end rsevents.EOF And rsevents.BOF %>

recordset = rsevents
column names = monthto and dayto
0
Comment
Question by:elliottbenzle
[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
2 Comments
 
LVL 25

Accepted Solution

by:
Rouchie earned 2000 total points
ID: 18034698
Try this as an alternative to your first line:

<%
If rsevents.Fields.Item("monthto").Value<> "Select Month" AND rsevents.Fields.Item("monthto").Value <> "Select Day" THEN
%>

Let me know the outcome...
0
 
LVL 4

Author Comment

by:elliottbenzle
ID: 18036009
wroks great. thanks
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Adobe Dreamweaver CS5 is a WYSIWYG web page editor that has advanced HTML, CSS, and Javascript rendering functionality and is probably the most well-known HTML editor available. Much of Dreamweaver's appeal centers around the Design View interfac…
This article is very specific and is only intended to help if you are installing Dreamweaver 8 in a Windows 7 environment with Office 2007 installed.   I'm not sure why Microsoft tends to release OS' that should not be released but they do.  Windows…
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: …
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

718 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