Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Development Tools
 Other Development Tools
 ASP to SQL Script

Author  Topic 

miranduh8
Starting Member

4 Posts

Posted - 2005-09-15 : 14:11:13
HELP!

I have used cold fusion in the past to develop but m y group just went to ASP. Is there a statement in ASP that I can use to basically do the same function as

cfif isdefined(url.field)

I am wanting to define a value using ASP that will equal today's date until defined in a url. In other words: If url.begindate is defined then I want Begindate = url.begindate. If its not defined in the url I want Begindate = 8/1/2005 (the first day of the previous month)

Any help would be greatly appreciated.


Miranda Hoskins

jsmith8858
Dr. Cross Join

7423 Posts

Posted - 2005-09-15 : 14:37:46
Kind of odd that you would choose SQLTeam as the place to get advice on ASP ....

if Request("field") returns "", then "field" is not defined. Otherwise, request("Field") returns the value that was passed.

Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2005-09-15 : 14:44:01
"if Request("field") returns "", then "field" is not defined."

Or is blank? I think you would need to actually loop around the Request collection to be sure it wasn't defined.

PITA basically!

Kristen
Go to Top of Page

miranduh8
Starting Member

4 Posts

Posted - 2005-09-15 : 14:49:39
I asked my question here because it is the only forum that have found that actually has questions and answers regarding several different programs with SQL Server.

Begindate will not be defined when the page is open. I am wanting to have it default to a the first day of the previous month. I have a form in my page that you can change the date. So I want Begindate to be what the date is changed to in my form.

Miranda
Go to Top of Page

jsmith8858
Dr. Cross Join

7423 Posts

Posted - 2005-09-15 : 14:51:41
I guess it depends on your definition of "defined" ... (not THAT is confusing!) .. That is a good point.

Most likely, you'll probably handle

http://someurl?x=

and

http://someurl

the same when it comes to checking the value of "x" , but you may want to distinguish between the two. I never do -- I don't think it makes much sense to consider those two situations different but your needs may vary.
Go to Top of Page
   

- Advertisement -