What is a "Foreword" to a blog?
If Then
Hello Guest
  
  • Login
• Register…
• Start blog
  • Who, Where, When
• What can I do?
• What to Read?
  • Polls
• Avatars
• Interests
  • Cities and Countries
• Random blog
• Users search
  • Search
• Games
• Tests
• QAIX
  • Сообщества
• Talxy Chat
• Horoscope
• Online
 
Зарегистрируйся!

QAIX > ASP web-programming > If Then 4 September 2008 11:08:02

  Recent blog posts: 
  Forums:   
  Discuss: 
  Recent forum topics: 
  Recent forum comments:
  Moderators:

If Then

Paulmitchell507 4 September 2008 11:08:02
 I am designing a small .asp (classic) application, I am connecting to
a Access 2k database via ADO to retrieve data. I have a number
variable's that contain text that is posted from a previous screen

AMPM = Request.Form("AMPM"­)
AMPMDate = Request.Form("AMPMD­ate")
halfday = "(" & AMPM & "," & AMPMDate & ")"

I then compose a CDOSYS email and send the value of the variable in
the .HTML body of the email

.HTML = "Number of Days" & halfday

What I would like to do is only display the value of the halfday
variable if it contains a value. I was thinking along the lines of

If halfday = Null Then
halfday = ""

Else

halfday = halfday

End if

I know this does not work, but it gives an idea of what I am trying to
achieve.
Any help would be appreciated.

Regards

Add comment
Bob Barrows 3 September 2008 17:49:34 permanent link ]
 paulmitchell507 wrote:
I am designing a small .asp (classic) application, I am connecting to
a Access 2k database via ADO to retrieve data. I have a number
variable's that contain text that is posted from a previous screen
AMPM = Request.Form("AMPM"­)
AMPMDate = Request.Form("AMPMD­ate")
halfday = "(" & AMPM & "," & AMPMDate & ")"
I then compose a CDOSYS email and send the value of the variable in
the .HTML body of the email
.HTML = "Number of Days" & halfday
What I would like to do is only display the value of the halfday
variable if it contains a value. I was thinking along the lines of
If halfday = Null Then

This will never be true. Comparisons to Null always result in Null. You
probably mean:

If halfday Is Null Then

However, this will also never be the case at this point because in your
previous statements, you assigned values to halfday. I think what you
intend to do is something like;

If AMPM = "" And AMPMDate = "" then
halfday=""
Else
halfday = "(" & AMPM & "," & AMPMDate & ")"
End if


--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.


Add comment
Anthony Jones 4 September 2008 11:08:02 permanent link ]
 "Bob Barrows [MVP]" <reb01501@NOyahoo.S­PAMcom> wrote in message
news:uzdFJRdDJHA.34­32@TK2MSFTNGP05.phx.­gbl...
paulmitchell507 wrote:
I am designing a small .asp (classic) application, I am connecting to
a Access 2k database via ADO to retrieve data. I have a number
variable's that contain text that is posted from a previous screen
AMPM = Request.Form("AMPM"­)
AMPMDate = Request.Form("AMPMD­ate")
halfday = "(" & AMPM & "," & AMPMDate & ")"
I then compose a CDOSYS email and send the value of the variable in
the .HTML body of the email
.HTML = "Number of Days" & halfday
What I would like to do is only display the value of the halfday
variable if it contains a value. I was thinking along the lines of
If halfday = Null Then
This will never be true. Comparisons to Null always result in Null. You
probably mean:
If halfday Is Null Then

Your VBScript getting a bit rusty Bob? ;)

If IsNull(halfday) Then

The Is keyword in VBScript tests the type of an object (via the
QueryInterface method).

--
Anthony Jones - MVP ASP/ASP.NET



Add comment
 

Add new comment

As:
Login:  Password:  
 
 
  
 
Пожалуйста, относитесь к собеседникам уважительно, не используйте нецензурные слова, не злоупотребляйте заглавными буквами, не публикуйте рекламу и объявления о купле/продаже, а также материалы нарушающие сетевой этикет или УК РФ.


QAIX > ASP web-programming > If Then 4 September 2008 11:08:02

see also:
function for current date-time
How to split a table?
Newbie needs help with ERROR: could not…
пройди тесты:
see also:
Everybody is a book
Greeting from VevoCart Team
How to Remove DRM from iTunes AAC M4V…

  Copyright © 2001—2008 QAIX
Idea: Miсhael Monashev
Помощь и задать вопросы можно в сообществе support.qaix.com.
Сообщения об ошибках оставляем в сообществе bugs.qaix.com.
Предложения и комментарии пишем в сообществе suggest.qaix.com.
Информация для родителей.
Write us at:
If you would like to report an abuse of our service, such as a spam message, please .