navigation
a webmaster learning community
     Home    Register     Search      Help      Login    
Sponsors

Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions.

Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.

Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

Search Forums
 

Advanced search
Recent Posts

 Todays Posts
 Most Active posts
 Posts since last visit
 My Recent Posts
 Mark posts read

Microsoft MVP

 

Issues pulling a correct date.

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> ASP and Database >> Issues pulling a correct date.
Page: [1] 2   next >   >>
 
fearnosurf

 

Posts: 149
Joined: 8/15/2005
Status: offline

 
Issues pulling a correct date. - 10/4/2005 14:06:53   
Ok, I'm at a loss on this one. In this code the person who coded it is correctly returning the correct "desired arrival date". I need to pull this date for a mailer that I'm sending out, but I don't belive he is setting a variable with it. Help!

The date selections that the user inputs is formatted liike this:
dim lsArrDt(140)
lsArrDt(1) = "3/12/2006 | 3/4/7/10/11/14/21 | BC/HH/HS | 3/12/2006"
lsArrDt(2) = "3/15/2006 | 4/11 | BC/HH/HS | 3/15/2006 (4, 11 night only)"
lsArrDt(3) = "3/16/2006 | 3/10 | BC/HH/HS | 3/16/2006 (3, 10 night only)"


ect....

Above I basically need to extract the 3/12/2006 date, and the following dates. Ideas?


sub msbArrivalLine(asSeq, asBkg, asArr, asNights, asHomes, asAff)

dim j1
dim k1
dim x1
dim x2
dim lsTxt1
dim lsTxt2
dim lsTxt3
dim lsTxt4
dim lsTxt5

ResReqFile.WriteLine("\trowd \trgaph108\trleft-108 ")

if asSeq = "b" then
ResReqFile.WriteLine("\clvertalb\cltxlrtb \cellx180")
ResReqFile.WriteLine("\clvertalb\cltxlrtb \cellx1980")
ResReqFile.WriteLine("\clvertalb\cltxlrtb \cellx3060")
ResReqFile.WriteLine("\clvertalb\cltxlrtb \cellx4050")
ResReqFile.WriteLine("\clvertalb\cltxlrtb \cltxlrtb \cellx4590")
ResReqFile.WriteLine("\clvertalb\cltxlrtb \cellx5940")
ResReqFile.WriteLine("\clvertalb\cltxlrtb \cltxlrtb \cellx6480")
ResReqFile.WriteLine("\clvertalb\cltxlrtb \cellx7830")
ResReqFile.WriteLine("\clvertalb\cltxlrtb \cltxlrtb \cellx10620")
ResReqFile.WriteLine("\pard ")
ResReqFile.WriteLine("\qc\widctlpar\intbl\adjustright ")
ResReqFile.WriteLine("{\fs20\cf8 }")
ResReqFile.WriteLine("{\cell }\pard ")
ResReqFile.WriteLine("\qr\widctlpar\intbl\adjustright ")
ResReqFile.WriteLine("{\fs20 }")
ResReqFile.WriteLine("{\cell }\pard ")
ResReqFile.WriteLine("\qc\widctlpar\intbl\adjustright ")
ResReqFile.WriteLine("{\fs18 }")
ResReqFile.WriteLine("{\cell }")
ResReqFile.WriteLine("{\fs16 }")
ResReqFile.WriteLine("{\fs20 }")
ResReqFile.WriteLine("{\cell }\pard ")
ResReqFile.WriteLine("\qr\widctlpar\intbl\adjustright ")
ResReqFile.WriteLine("{\fs16 }{\cell }\pard \qc\widctlpar\intbl\adjustright ")
ResReqFile.WriteLine("{\fs20 }")
ResReqFile.WriteLine("{\fs16 \cell }\pard ")
ResReqFile.WriteLine("\widctlpar\intbl\adjustright ")
ResReqFile.WriteLine("{\fs20 }")
else
if asSeq = "0" then
lsTxt1 = " "
lsTxt2 = "{\fs16 Alternate Arrival Date:"
ResReqFile.WriteLine("\clvertalb\cltxlrtb \cellx180")
else
lsTxt1 = asSeq
lsTxt2 = "{\b\fs16 Desired Arrival Date:"
ResReqFile.WriteLine("\clvertalb" & asBkg & "\cltxlrtb \cellx180")
end if
ResReqFile.WriteLine("\clvertalb\cltxlrtb \cellx1980")
ResReqFile.WriteLine("\clvertalb\clbrdrb\brdrs\brdrw10 \cltxlrtb \cellx3060")
ResReqFile.WriteLine("\clvertalb\cltxlrtb \cellx4050")
ResReqFile.WriteLine("\clvertalb\clbrdrb\brdrs\brdrw10 \cltxlrtb \cellx4590")
ResReqFile.WriteLine("\clvertalb\cltxlrtb \cellx5940")
ResReqFile.WriteLine("\clvertalb\clbrdrb\brdrs\brdrw10 \cltxlrtb \cellx6480")
ResReqFile.WriteLine("\clvertalb\cltxlrtb \cellx7830")
ResReqFile.WriteLine("\clvertalb\clbrdrb\brdrs\brdrw10 \cltxlrtb \cellx10620")
ResReqFile.WriteLine("\pard ")
ResReqFile.WriteLine("\qc\widctlpar\intbl\adjustright ")
Spooky

 

Posts: 26603
Joined: 11/11/1998
From: Middle Earth
Status: offline

 
RE: Issues pulling a correct date. - 10/4/2005 16:25:51   
Each of these is the individual record that you want to extract the date from?

lsArrDt(1)
lsArrDt(2)
lsArrDt(3)

At the simplest level, you would want to ask for

trim(Left(IsAarrDt(i),10))

_____________________________

If you arent part of the solution, then there is good money to be made prolonging the problem

§þ:)


(in reply to fearnosurf)
fearnosurf

 

Posts: 149
Joined: 8/15/2005
Status: offline

 
RE: Issues pulling a correct date. - 10/7/2005 11:16:39   
that is correct, each of those lsArrDt is a record, that if selected I will need to return it, but only the date portion.

Thank you for your reply, I have further questions if you don't mind continuing to help me.

trim(Left(IsAarrDt(i),10))

ok, I know that trim removes spaces, but could you explain what the (i),10 does? And how could I incooperate this into a Mailer?

(in reply to Spooky)
fearnosurf

 

Posts: 149
Joined: 8/15/2005
Status: offline

 
RE: Issues pulling a correct date. - 10/7/2005 12:28:13   
ok I'm guessing the trim works as such...

trim(Left(IsAarrDt(i),10)) left align, only use the first 10 spaces... but what does (i) meant?

(in reply to fearnosurf)
fearnosurf

 

Posts: 149
Joined: 8/15/2005
Status: offline

 
RE: Issues pulling a correct date. - 10/7/2005 12:29:15   
once I have the data trimmed, what/how would be the best way to set it as a variable, to use it in the mailer?

(in reply to fearnosurf)
fearnosurf

 

Posts: 149
Joined: 8/15/2005
Status: offline

 
RE: Issues pulling a correct date. - 10/7/2005 12:32:22   
Ug, nevermind on the how do I set it as a variable.

I could:

Dim XXX

XXX= trim(Left(IsAarrDt(i),10))



yes?

(in reply to fearnosurf)
dpf

 

Posts: 7123
Joined: 11/12/2003
From: India-napolis
Status: offline

 
RE: Issues pulling a correct date. - 10/7/2005 12:38:51   
quote:

yes?
yes

_____________________________

Dan

(in reply to fearnosurf)
fearnosurf

 

Posts: 149
Joined: 8/15/2005
Status: offline

 
RE: Issues pulling a correct date. - 10/7/2005 12:44:19   
Ok, this doesn't work. Can someone explain the (i) to me?

<%
session("Membersresconf") = trim(Left(Request.Form("arrDt")(i),10)) & " " & Request.Form("nights")(i) & " " & Request.Form("homes")(i) & chr(13)
%>

(in reply to dpf)
fearnosurf

 

Posts: 149
Joined: 8/15/2005
Status: offline

 
RE: Issues pulling a correct date. - 10/7/2005 13:30:11   
OK, I've repaired it. Now here's my delima"
I need to take all of the data that is inputed and return it later in the mailer. The Trim is working beautifully, but I'm only able to store the first entry. here's how I'm doing it.

<%
session("Membersresconf") = trim(Left(Request.Form("arrDt11"),10)) & " " & Request.Form("nights11") & " " & Request.Form("homes11")
							trim(Left(Request.Form("arrDt12"),10)) & " " & Request.Form("nights12") & " " & Request.Form("homes12") & chr(13)
%>


How can I effectively store multiple arrDt(21 of them) and trim them, and use them later on?

(in reply to fearnosurf)
rdouglass

 

Posts: 9270
From: Biddeford, ME USA
Status: offline

 
RE: Issues pulling a correct date. - 10/7/2005 13:46:42   
I'd use an array. If you know you have 21 items, something like this might work.

<%DIM myArray(20) 'arrays are 0 based

FOR i = 0 TO 20
myArray(i) = youritem(i)
NEXT%>

The trick is figuring out youritem(i). Does it come from a list or fields or a db or what?

_____________________________

Don't take you're eye off your final destination.

ASP Checkbox Function Tutorial.

(in reply to fearnosurf)
fearnosurf

 

Posts: 149
Joined: 8/15/2005
Status: offline

 
RE: Issues pulling a correct date. - 10/7/2005 13:54:24   
it comes from a list that is dim'd, then that list is populated within a drop down box in the form that the user selects from.

I need to return the selection(s) in a mailer, but I don't need all of the info, hence the trim.

So I need a way to return the data that the user selects, but trim it down to the date. Also, there are some fields the user may not need, in that case, I don't want to return the blanks.


Ideas?

(in reply to rdouglass)
rdouglass

 

Posts: 9270
From: Biddeford, ME USA
Status: offline

 
RE: Issues pulling a correct date. - 10/7/2005 14:13:01   
quote:

I need to return the selection(s)


How do you determine them? WHere do they come from?

I aplogize but I haven't been following your thread at all.

_____________________________

Don't take you're eye off your final destination.

ASP Checkbox Function Tutorial.

(in reply to fearnosurf)
fearnosurf

 

Posts: 149
Joined: 8/15/2005
Status: offline

 
RE: Issues pulling a correct date. - 10/7/2005 14:24:21   
Not a problem, I appreciate any help I can get.

here is the form field...(there are 21 of these, numbered like so... arrDt11, arrDt12, etc...)
<select name="arrDt11">
<%
if psArrDt11 = "" then
%>
    <option value="(none)" SELECTED> </option>
<%
else
%>
    <option value="(none)"> </option>
<%
end if

for ArrDtIx = 1 to ArrDtMax
  j1 = mfnInstrRev(lsArrDt(ArrDtIx),"|")
  x1 = trim(mid(lsArrDt(ArrDtIx), j1 + 1))
  if lsArrDt(ArrDtIx) = psArrDt11 then
%>
    <option value="<%=lsArrDt(ArrDtIx)%>" SELECTED><%=x1%></option>
<%
  else
%>
    <option value="<%=lsArrDt(ArrDtIx)%>"><%=x1%></option>
<%
  end if
next
%>
                  </select>



All 21 of these use the the ArrDt list. It is defined by Dim (there are several hundred of the list items below)

dim lsArrDt(140)
lsArrDt(1) = "3/12/2006 | 3/4/7/10/11/14/21 | BC/HH/HS | 3/12/2006"
lsArrDt(2) = "3/15/2006 | 4/11 | BC/HH/HS | 3/15/2006 (4, 11 night only)"
lsArrDt(3) = "3/16/2006 | 3/10 | BC/HH/HS | 3/16/2006 (3, 10 night only)"
lsArrDt(4) = "3/19/2006 | 3/4/7/10/11/14/21 | BC/HH/HS | 3/19/2006"
lsArrDt(5) = "3/22/2006 | 4/11 | BC/HH/HS | 3/22/2006 (4, 11 night only)"
lsArrDt(6) = "3/23/2006 | 3/10 | BC/HH/HS | 3/23/2006 (3, 10 night only)"


Because so much of the rest of the form uses these how they are, I cannot change them. So, I have to figure out a way to return just the date for each of the arrDt fields.

What I was thinking was setting them as a session and calling them when I do the mailer. But my session only returns the first one for some reason.

below I'm just calling on arrDt11 & arrDt12....only 11 is returned when I call the session back.

<%
session("Membersresconf") = trim(Left(Request.Form("arrDt11"),10)) & " " & Request.Form("nights11") & " " & Request.Form("homes11") & chr(13)
trim(Left(Request.Form("arrDt12"),10)) & " " & Request.Form("nights12") & " " & Request.Form("homes12") & chr(13)
%>


(in reply to rdouglass)
rdouglass

 

Posts: 9270
From: Biddeford, ME USA
Status: offline

 
RE: Issues pulling a correct date. - 10/7/2005 14:34:59   
quote:

<%DIM myArray(20) 'arrays are 0 based

FOR i = 0 TO 20
myArray(i) = youritem(i)
NEXT%>


Well, I still think an array is the way to go so let's try this:

Do this on the same page you post the form to:

<%DIM myArray(20) 'arrays are 0 based

FOR i = 0 TO 20
myArray(i) = trim(Left(Request.Form("arrDt"&(i+11)),10)) & " " & Request.Form("nights"&(i+11)) & " " & Request.Form("homes"&(i+11)) & chr(13)
NEXT%>

Then check your resulting array by doing this:

<%FOR i = 0 TO ubound(myArray)
Response.write((i+11) & ":" & myArray(i) & ">br>")
NEXT%>

Are the 21 dates spit out 1 to a line? I expect something like this:

11:01/01/2005
12:01/01/2005
13:02/01/2005
....

That should put your items into an array for later use. If we can get that far, then we can loop thru the array (in the same manner) and send emails as needed.

_____________________________

Don't take you're eye off your final destination.

ASP Checkbox Function Tutorial.

(in reply to fearnosurf)
fearnosurf

 

Posts: 149
Joined: 8/15/2005
Status: offline

 
RE: Issues pulling a correct date. - 10/7/2005 16:19:02   
ok, I tried that and all it did was write 11: <br> 12: <br> etc...

(in reply to rdouglass)
rdouglass

 

Posts: 9270
From: Biddeford, ME USA
Status: offline

 
RE: Issues pulling a correct date. - 10/7/2005 16:29:32   
quote:

Do this on the same page you post the form to:


Are you doing that? Not on the page that the form is on but on the page you're posting to. If it is the same page, this won't work until you post the form.

_____________________________

Don't take you're eye off your final destination.

ASP Checkbox Function Tutorial.

(in reply to fearnosurf)
fearnosurf

 

Posts: 149
Joined: 8/15/2005
Status: offline

 
RE: Issues pulling a correct date. - 10/7/2005 16:30:25   
Correct, I placed it on the page the form posts too.

(in reply to rdouglass)
fearnosurf

 

Posts: 149
Joined: 8/15/2005
Status: offline

 
RE: Issues pulling a correct date. - 10/7/2005 16:34:25   
It displays like this

11: >br>12: >br>13: >br>14: >br>15: >br>16: >br>17: >br>18: >br>19: >br>20: >br>21: >br>22: >br>23: >br>24: >br>25: >br>26: >br>27: >br>28: >br>29: >br>30: >br>31: >br>

(in reply to fearnosurf)
rdouglass

 

Posts: 9270
From: Biddeford, ME USA
Status: offline

 
RE: Issues pulling a correct date. - 10/7/2005 16:36:44   
quote:

<%DIM myArray(20) 'arrays are 0 based

FOR i = 0 TO 20
myArray(i) = trim(Left(Request.Form("arrDt"&(i+11)),10)) & " " & Request.Form("nights"&(i+11)) & " " & Request.Form("homes"&(i+11)) & chr(13)
NEXT%>


Just as a quick test for me, can you change this temporarily to

<%DIM myArray(20) 'arrays are 0 based

FOR i = 0 TO 20
myArray(i) = Request.Form("arrDt"&(i+11))
NEXT%>

_____________________________

Don't take you're eye off your final destination.

ASP Checkbox Function Tutorial.

(in reply to fearnosurf)
fearnosurf

 

Posts: 149
Joined: 8/15/2005
Status: offline

 
RE: Issues pulling a correct date. - 10/7/2005 16:39:39   
11:>br>12:>br>13:>br>14:>br>15:>br>16:>br>17:>br>18:>br>19:>br>20:>br>21:>br>22:>br>23:>br>24:>br>25:>br>26:>br>27:>br>28:>br>29:>br>30:>br>31:>br>

Same thing.

(in reply to rdouglass)
fearnosurf

 

Posts: 149
Joined: 8/15/2005
Status: offline

 
RE: Issues pulling a correct date. - 10/7/2005 16:41:29   
Let me specify in case this helps. The fields are named:
arrDt11
arrDt12
arrDt13
arrDt21
arrDt22
arrDt23
arrDt31
arrDt32
arrDt33
arrDt41
arrDt42
arrDt43
arrDt51
arrDt52
arrDt53
arrDt61
arrDt62
arrDt63
arrDt71
arrDt72
arrDt73

(in reply to fearnosurf)
rdouglass

 

Posts: 9270
From: Biddeford, ME USA
Status: offline

 
RE: Issues pulling a correct date. - 10/7/2005 19:56:10   
Ouch! So the numbers aren't in numerical sequence then are they? :) That's OK tho - we can deal with that when the time comes. If you don't mind I'd like to try a coupla' things - one at a time.

First I want to check and see if we're getting the form data at all 'cause I'm a little suspicious of that. How bout a quick test of this:

<%DIM myArray(20) 'arrays are 0 based

FOR i = 0 TO 1
myArray(i) = Request.Form("arrDt11")
Response.write(myArray(i) & "<br>")
NEXT%>

Are we picking up the form values? Somehow I suspect not.

_____________________________

Don't take you're eye off your final destination.

ASP Checkbox Function Tutorial.

(in reply to fearnosurf)
fearnosurf

 

Posts: 149
Joined: 8/15/2005
Status: offline

 
RE: Issues pulling a correct date. - 10/10/2005 11:20:04   
quote:


Are we picking up the form values? Some


That doesn't work.


I've done some research, and there is a session that is created entitled ("resBookingDetail')

I can pull all the data I need from this, the problem is filtering it. When I call it in the Mailer like so:
lsMailBody2 = lsMailBody2 & "Season: " & session("resBookingDetail") & chr(13)

It displays all information, including what was not selected.

Season: 3/15/2006 | 4/11 | BC/HH/HS | 3/15/2006 (4, 11 night only)~4~1~NULL~(none)~0~0~NULL~(none)~0~0~NULL~(none)~0~0
~NULL~(none)~0~0~NULL~(none)~0~0~NULL~(none)~0~0~NULL~(none)~0~0~NULL
~(none)~0~0~NULL~(none)~0~0~NULL~(none)~0~0~NULL~(none)~0~0~NULL~(none)
~0~0~NULL~(none)~0~0~NULL~(none)~0~0~NULL~(none)~0~0~NULL~(none)~0~0~NULL~
(none)~0~0~NULL~(none)~0~0~NULL~(none)~0~0~NULL~(none)~0~0~NULL~

I need to only recall the the information above that I have bolded.

Is there anyway to extract the info I need, and if the other have no value then make them not display?

On the Form, the session is created here: You can see it has all the content I need.
<%
dim lsReservationException
lsReservationException = ""

if session("resBookingHeader") = "" then
  msbInitBookingVariables
else
  msbParseBookingVariables
end if

if Request.Form("MM_dangit") = "homehigh_non_pv" then
		x1 = CStr(Request.ServerVariables("SCRIPT_NAME"))
		j1 = mfnInstrRev(x1, "/")
		if j1 > 0 then
		  x1 = mid(x1, j1 + 1)
		end if
		session("resBookingHeader") = x1 & "~" & _
		                              lsToday & "~" & _
		                              replace(request.form("MemberName"), "~", "-") & "~" & _
		                              replace(request.form("daytimePhones"), "~", "-") & "~" & _
		                              replace(request.form("emailAddress"), "~", "-") & "~" & _
		                              replace(request.form("homeClub"), "~", "-") & "~" & _
		                              replace(request.form("nightCount"), "~", "-") & "~" & _
		                              replace(request.form("specialReqs"), "~", "-") & "~" & _
		                              "One_Bedroom" & "~" & _
		                              "Two_Bedroom" & "~" & _
		                              "Three_Bedroom" & "~" & _
		                              "Four_Bedroom" & "~" & _
		                              "Flex_Bedroom" & "~" & _
		                              "Season_To_Use"
		session("resBookingDetail") = Request.Form("arrDt11") & "~" & _
		                       Request.Form("nights11") & "~" & _
		                       Request.Form("homes11") & "~" & _
		                       "NULL" & "~" & _
		                       Request.Form("arrDt12") & "~" & _
		                       Request.Form("nights12") & "~" & _
		                       Request.Form("homes12") & "~" & _
		                       "NULL" & "~" & _
		                       Request.Form("arrDt13") & "~" & _
		                       Request.Form("nights13") & "~" & _
		                       Request.Form("homes13") & "~" & _
		                       "NULL" & "~" & _
		                       Request.Form("arrDt21") & "~" & _
		                       Request.Form("nights21") & "~" & _
		                       Request.Form("homes21") & "~" & _
		                       "NULL" & "~" & _
		                       Request.Form("arrDt22") & "~" & _
		                       Request.Form("nights22") & "~" & _
		                       Request.Form("homes22") & "~" & _
		                       "NULL" & "~" & _
		                       Request.Form("arrDt23") & "~" & _
		                       Request.Form("nights23") & "~" & _
		                       Request.Form("homes23") & "~" & _
		                       "NULL" & "~" & _
		                       Request.Form("arrDt31") & "~" & _
		                       Request.Form("nights31") & "~" & _
		                       Request.Form("homes31") & "~" & _
		                       "NULL" & "~" & _
		                       Request.Form("arrDt32") & "~" & _
		                       Request.Form("nights32") & "~" & _
		                       Request.Form("homes32") & "~" & _
		                       "NULL" & "~" & _
		                       Request.Form("arrDt33") & "~" & _
		                       Request.Form("nights33") & "~" & _
		                       Request.Form("homes33") & "~" & _
		                       "NULL" & "~" & _
		                       Request.Form("arrDt41") & "~" & _
		                       Request.Form("nights41") & "~" & _
		                       Request.Form("homes41") & "~" & _
		                       "NULL" & "~" & _
		                       Request.Form("arrDt42") & "~" & _
		                       Request.Form("nights42") & "~" & _
		                       Request.Form("homes42") & "~" & _
		                       "NULL" & "~" & _
		                       Request.Form("arrDt43") & "~" & _
		                       Request.Form("nights43") & "~" & _
		                       Request.Form("homes43") & "~" & _
		                       "NULL" & "~" & _
		                       Request.Form("arrDt51") & "~" & _
		                       Request.Form("nights51") & "~" & _
		                       Request.Form("homes51") & "~" & _
		                       "NULL" & "~" & _
		                       Request.Form("arrDt52") & "~" & _
		                       Request.Form("nights52") & "~" & _
		                       Request.Form("homes52") & "~" & _
		                       "NULL" & "~" & _
		                       Request.Form("arrDt53") & "~" & _
		                       Request.Form("nights53") & "~" & _
		                       Request.Form("homes53") & "~" & _
		                       "NULL" & "~" & _
		                       Request.Form("arrDt61") & "~" & _
		                       Request.Form("nights61") & "~" & _
		                       Request.Form("homes61") & "~" & _
		                       "NULL" & "~" & _
		                       Request.Form("arrDt62") & "~" & _
		                       Request.Form("nights62") & "~" & _
		                       Request.Form("homes62") & "~" & _
		                       "NULL" & "~" & _
		                       Request.Form("arrDt63") & "~" & _
		                       Request.Form("nights63") & "~" & _
		                       Request.Form("homes63") & "~" & _
		                       "NULL" & "~" & _
		                       Request.Form("arrDt71") & "~" & _
		                       Request.Form("nights71") & "~" & _
		                       Request.Form("homes71") & "~" & _
		                       "NULL" & "~" & _
		                       Request.Form("arrDt72") & "~" & _
		                       Request.Form("nights72") & "~" & _
		                       Request.Form("homes72") & "~" & _
		                       "NULL" & "~" & _
		                       Request.Form("arrDt73") & "~" & _
		                       Request.Form("nights73") & "~" & _
		                       Request.Form("homes73") & "~" & _
		                       "NULL" & "~"
	msbParseBookingVariables
	lsReservationException = EditReservationFields()
	if lsReservationException = "" then
		response.redirect("homehigh_res_finish.asp")
	else
        session("resBookingHeader") = ""
        session("resBookingDetail") = ""
		lsReservationException = lsReservationException & "</ul>Please correct and resubmit." 
	end if
end if
%>



(in reply to rdouglass)
fearnosurf

 

Posts: 149
Joined: 8/15/2005
Status: offline

 
RE: Issues pulling a correct date. - 10/11/2005 9:49:47   
anyone?

(in reply to fearnosurf)
fearnosurf

 

Posts: 149
Joined: 8/15/2005
Status: offline

 
RE: Issues pulling a correct date. - 10/12/2005 10:29:36   
Would someone mind taking a look at my last post? :)

I'm pretty sure I'm close, if I could ask for a bit more guideance.

(in reply to fearnosurf)
fearnosurf

 

Posts: 149
Joined: 8/15/2005
Status: offline

 
RE: Issues pulling a correct date. - 10/17/2005 14:18:09   
bump

(in reply to fearnosurf)
rdouglass

 

Posts: 9270
From: Biddeford, ME USA
Status: offline

 
RE: Issues pulling a correct date. - 10/17/2005 14:54:02   
quote:

Season: 3/15/2006 | 4/11 | BC/HH/HS | 3/15/2006 (4, 11 night only)~4~1~NULL~(


So you only need the bolded info above? So the first date after "Season:" and the first two numbers after the first ~? Are those always the delimiters? Will they always be in the same place?

If so, this script should pull otu those items you need:

<%DIM myVariable, myTempVariable, myFirstPart, mySecondPart, myThirdPart

myVariable=session("resBookingDetail")

myTempVariable = myVariable
myTempVariable=trim(right(myTempVariable,len(myTempVariable)-instr(myTempVariable,":")))
myFirstPart = trim(left(myTempVariable,(instr(myTempVariable," ")-1)))

myTempVariable=trim(right(myTempVariable,len(myTempVariable)-instr(myTempVariable,"~")))
mySecondPart = trim(left(myTempVariable,(instr(myTempVariable,"~")-1)))

myTempVariable=trim(right(myTempVariable,len(myTempVariable)-instr(myTempVariable,"~")))
myThirdPart = trim(left(myTempVariable,(instr(myTempVariable,"~")-1)))

Response.write(myFirstPart & "<br>")
Response.write(mySecondPart & "<br>")
Response.write(myThirdPart & "<br>")

%>

Sorry it took me so long to get back to you. :) That help any?

_____________________________

Don't take you're eye off your final destination.

ASP Checkbox Function Tutorial.

(in reply to fearnosurf)
fearnosurf

 

Posts: 149
Joined: 8/15/2005
Status: offline

 
RE: Issues pulling a correct date. - 10/18/2005 14:36:04   
Thank you for your help.

That works great, but I still need to be able to return the other data IF it has been selected.

ResBookingDetail has the info in it from all of the input fields:

arrDt11, nights11, homes11
arrDt12, nights12, homes12
arrDt13, nights13, homes13
arrDt21, nights21, homes21
arrDt22, nights22, homes22
arrDt23, nights23, homes23
arrDt31, nights31, homes31
arrDt32, nights32, homes32
arrDt33, nights33, homes33
arrDt41, nights41, homes41
arrDt42, nights42, homes42
arrDt43, nights43, homes43
arrDt51, nights51, homes51
arrDt52, nights52, homes52
arrDt53, nights53, homes53
arrDt61, nights61, homes61
arrDt62, nights62, homes62
arrDt63, nights63, homes63
arrDt71, nights71, homes71
arrDt72, nights72, homes72
arrDt73, nights73, homes73

These are all of the variables that I need to return. Maybe I should create a new session with all of the info from each field? The issue I have is how to I make it store in the session only IF it has been selected? Or, how do I return it only IF it has been selected?



(in reply to rdouglass)
rdouglass

 

Posts: 9270
From: Biddeford, ME USA
Status: offline

 
RE: Issues pulling a correct date. - 10/18/2005 15:31:00   
quote:

Season: 3/15/2006 | 4/11 | BC/HH/HS | 3/15/2006 (4, 11 night only)~4~1~NULL~(none)~0~0~NULL~(none)~0~0~NULL~(none)~0~0
~NULL~(none)~0~0~NULL~(none)~0~0~NULL~(none)~0~0~NULL~(none)~0~0~NULL
~(none)~0~0~NULL~(none)~0~0~NULL~(none)~0~0~NULL~(none)~0~0~NULL~(none)
~0~0~NULL~(none)~0~0~NULL~(none)~0~0~NULL~(none)~0~0~NULL~(none)~0~0~NULL~
(none)~0~0~NULL~(none)~0~0~NULL~(none)~0~0~NULL~(none)~0~0~NULL~


I apologize but I need to clarify what we're doing here. This data I quoted directly above, is that the session data you're trying to pull all those field parameters out of?

If so, there are 2 ways that I can think of to do it. One (and which I see is the easier of the two) is to add another separator in your session to know when we're separating records. Something like:

....
session("resBookingDetail") = "|" & Request.Form("arrDt11") & "~" & _
Request.Form("nights11") & "~" & _
Request.Form("homes11") & "~" & _
"NULL" & "~" & _
"|" & Request.Form("arrDt12") & "~" & _
Request.Form("nights12") & "~" & _
Request.Form("homes12") & "~" & _
"NULL" & "~" & _
"|" & Request.Form("arrDt13") & "~" & _
Request.Form("nights13") & "~" & _
....

See, I'm adding another special char to aid in us separating those records. If that works, we should be able to apply a similar method to pull the data out by first separating the records.

However, if that will mess up other stuff (you said this was put in by the original developer), we'll have to take another route. It will be messy, but we can do it. It would be a big excersize in "left", "right", etc. but we can do it that way. Not my preferred method in this case, but it is possible.

Some thoughts for you:

My questions to you would be "Did you dig in the code anywhere to see if you can find out how they disect the session?" IOW, what are the original developers doing with that session data? Are they dumping it into a single field or are they pulling stuff out? There may already be code in an include file or something that you can use or call.

Also, it may be easier to write your own sessions (or cookies or database values) at the same time they are. Then you can form them any way you want and get the stuff out far easier.

Sometimes I can't see the forest 'cause of the trees.

_____________________________

Don't take you're eye off your final destination.

ASP Checkbox Function Tutorial.

(in reply to fearnosurf)
fearnosurf

 

Posts: 149
Joined: 8/15/2005
Status: offline

 
RE: Issues pulling a correct date. - 10/18/2005 16:06:05   
I can try to add that seperator, but his code is so garbled I'm having issues tracking everything down to find out exactly what it all does.

The train of thought I've been on today is creating another session, like you said, and grabbing the variables that way. my problem is that how would I make it return nothing when nothing is selected and still store all of the ones chosen to a session so that I can return it later?


In answer to your question at the begining, I can either pull the Session that is already created, or pull the variable itself.

(in reply to rdouglass)
Page:   [1] 2   next >   >>

All Forums >> Web Development >> ASP and Database >> Issues pulling a correct date.
Page: [1] 2   next >   >>
Jump to: 1





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts