Is that the line that the error message says the error is happening on? Presumably you have all that on two lines in your code and it's just wrapped in the email? Dan
________________________________ From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Valter Sent: 27 October 2005 16:56 To: [email protected] Subject: [AspClassicAnyQuestionIsOk] Re: Quotation table ok this is the line which might cause the error: <% set val2 = outpostDB.Execute("SELECT [fondi].[id_fondo], [fondi]. [nome_fondo], (SELECT TOP 1 [valore_quota] FROM [valori] WHERE [id] = [fondi].[id_fondo] ORDER BY [data_quota] DESC) AS [CurrentValue], (SELECT TOP 1 [valore_quota] FROM [valori] WHERE [id] = [fondi].[id_fondo] AND [data_quota] < (SELECT TOP 1 [data_quota] FROM [valori] WHERE [id] = [fondi].[id_fondo] ORDER BY [data_quota] DESC) AS [LastValue] FROM [fondi]") Do While Not val2.EOF %> Thanks Valter --- In [email protected], "Dan Powderhill" <[EMAIL PROTECTED]> wrote: > > The SQL query won't cause a VBScript compilation error. It'll be > something like a missing " - post the line of code which is causing the > error? > > Dan > > ________________________________ > > From: [email protected] > [mailto:[EMAIL PROTECTED] On Behalf Of Valter > Sent: 27 October 2005 12:13 > To: [email protected] > Subject: [AspClassicAnyQuestionIsOk] Re: Quotation table > > > Hi Dan, > sorry I keep bothering you with the same problem. > I did try to use your query as it was but it return me the error : > Microsoft VBScript compilation (0x800A0409) > Unterminated string constant > Actually, I did try also to spit it as below, but alltho isn't > returning errors the page is perfecty....blank!! > Here is the code: > <%@ LANGUAGE="VBSCRIPT" %> > <% > Dim outpostDB > Dim outpostDBPath > stroutpostDBPath = Server.MapPath("../GestAlt/alternative.mdb") > %> > <% > set outpostDB = Server.CreateObject("ADODB.Connection") > outpostDB.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & > stroutpostDBPath & ";" > %> > <% > set fondo = outpostDB.Execute("SELECT id_fondo,nome_fondo from fondi") > Do While Not fondo.EOF > id_fondo = fondo("id_fondo") > nome = fondo("nome_fondo") > %> > <% > set val1 = outpostDB.Execute("SELECT TOP 1 valore_quota from valori > where id = "&id_fondo&" order by data_quota desc") > Do While Not val1.EOF > valore1 = val1("valore_quota") > %> > <% > set data = outpostDB.Execute("SELECT TOP 1 data_quota from valori > where id = "&id_fondo&" order by data_quota desc") > Do While Not data.EOF > data_quota = data("data_quota") > %> > <% > set val2 = outpostDB.Execute("SELECT TOP 1 valore_quota from valori > where id = "&id_fondo&" and data_quota < "&data_quota&"") > Do While Not val2.EOF > valore2 = val2("valore_quota") > %> > <table> > <tr> > <td><%= nome %><br></td><td><%= valore1 %><br></td><td><%= valore2 % > ><br></td> > </tr> > </table> > <% > val2.MoveNext > Loop > %> > <% > data.MoveNext > Loop > %> > <% > val1.MoveNext > Loop > %> > <% > fondo.MoveNext > Loop > %> > <% > val2.Close > set val2 = Nothing > %> > <% > data.Close > set data = Nothing > %> > <% > val1.Close > set val1 = Nothing > %> > <% > fondo.Close > set fondo = Nothing > %> > <% > outpostDB.Close > set outpostDB = Nothing > %> > Thank you for your patience and guts coz I guess this might be the > worst asp code u've ever seen.... > > Valter > > --- In [email protected], "Dan Powderhill" > <[EMAIL PROTECTED]> wrote: > > > > Can't you transform the values into that format in your code? i.e. > store > > them in variables as they come out of the recordset and then > manipulate > > them however you please? > > > > If not, the following SQL should do what you need, although it will > > perform slower over a large number of records than doing it in > code:- > > > > SELECT [fondi].[ID], [fondi].[nome_fondo], (SELECT TOP 1 > [valore_quota] > > FROM [valori] WHERE [id_fondo] = [fondi].[ID] ORDER BY [data_quota] > > DESC) AS [CurrentValue], (SELECT TOP 1 [valore_quota] FROM [valori] > > WHERE [id_fondo] = [fondi].[ID] AND [data_quota] < (SELECT TOP 1 > > [data_quota] FROM [valori] WHERE [id_fondo] = [fondi].[ID] ORDER BY > > [data_quota] DESC) ORDER BY [data_quota] DESC) AS [LastValue] FROM > > [fondi]; > > > > Dan > > > > ________________________________ > > > > From: [email protected] > > [mailto:[EMAIL PROTECTED] On Behalf Of > Valter > > Sent: 26 October 2005 07:12 > > To: [email protected] > > Subject: [AspClassicAnyQuestionIsOk] Re: Quotation table > > > > > > Thank you very much for your help, > > probably I didn't get something but when I run the query as below > > > > "Select TOP 2 valore_quota, nome_fondo from valori, fondi where id > = > > id_fondo order by data_quota desc" > > > > it returns me two rows like the following > > Fund1 value1 > > Fund1 value2 > > > > instead of > > Fund1 value1 value2 > > as I actually need. > > Later I might have to calculate the difference between the two > values > > (value1 - value2). > > > > Thank you very much once again. > > Valter > > --- In [email protected], "Dan Powderhill" > > <[EMAIL PROTECTED]> wrote: > > > > > > A table for the fund names and a table for the values relating to > > the > > > funds. > > > > > > Dan > > > > > > ________________________________ > > > > > > From: [email protected] > > > [mailto:[EMAIL PROTECTED] On Behalf Of > > Valter > > > Sent: 25 October 2005 16:26 > > > To: [email protected] > > > Subject: [AspClassicAnyQuestionIsOk] Re: Quotation table > > > > > > > > > Do you mean two tables for each fund? > > > Thank you > > > Valter > > > > > > > > > --- In [email protected], "Dan > Powderhill" > > > <[EMAIL PROTECTED]> wrote: > > > > > > > > Normalise it into two tables:- > > > > > > > > tblFunds > > > > ------------ > > > > ID > > > > FundName > > > > > > > > tblFundValues > > > > -------------------- > > > > ID > > > > FundID > > > > Value > > > > Date > > > > > > > > Then you can have a history of values by date for every fund, > and > > > using > > > > basic SQL will be able to bring back the current and current- > but- > > one > > > > values using the TOP keyword (SELECT TOP 2 [Value] FROM > > > [tblFundValues] > > > > ORDER BY [Date] DESC) etc. > > > > > > > > Dan > > > > > > > > ________________________________ > > > > > > > > From: [email protected] > > > > [mailto:[EMAIL PROTECTED] On Behalf Of > > > Valter > > > > Sent: 25 October 2005 12:40 > > > > To: [email protected] > > > > Subject: [AspClassicAnyQuestionIsOk] Quotation table > > > > > > > > > > > > For my personal project I am trying to design a table in which > > > there > > > > will be a list of funds, their last month value and their > > previous > > > > month value. I do know how to make it with only one fund but > with > > > many > > > > of them I've found some problems. Can anybody help me? > > > > I draft a sample of the table how it should look: > > > > Fund1 last_value prev_value > > > > Fund2 last_value prev_value > > > > ... > > > > ... > > > > I can have a table for each fund with all values order by date > > > > > > > > Thank you > > > > > > > > > > > > > > > > > > > > > > > > > > > > SPONSORED LINKS > > > > Basic programming language > > > > <http://groups.yahoo.com/gads? > > > t=ms&k=Basic+programming+language&w1=Basic > > > > > > > > > > +programming+language&w2=Computer+programming+languages&w3=Programming > > > +l > > > > > > > > > > anguages&w4=Java+programming+language&c=4&s=126&.sig=bnac3LCZpttb3c9Fv > > > bV > > > > U-A> Computer programming languages > > > > <http://groups.yahoo.com/gads? > > > t=ms&k=Computer+programming+languages&w1=B > > > > > > > > > > asic+programming+language&w2=Computer+programming+languages&w3=Program > > > mi > > > > > > > > > > ng+languages&w4=Java+programming+language&c=4&s=126&.sig=1Czd2hKCO9_u4 > > > KV > > > > ZQperFQ> Programming languages > > > > <http://groups.yahoo.com/gads? > > > t=ms&k=Programming+languages&w1=Basic+prog > > > > > > > > > > ramming+language&w2=Computer+programming+languages&w3=Programming+lang > > > ua > > > > > > > > > > ges&w4=Java+programming+language&c=4&s=126&.sig=TyHGCjod4YOKITrSq1xccQ > > > > > > > > > > > > Java programming language > > > > <http://groups.yahoo.com/gads? > > > t=ms&k=Java+programming+language&w1=Basic+ > > > > > > > > > > programming+language&w2=Computer+programming+languages&w3=Programming+ > > > la > > > > > > > > > > nguages&w4=Java+programming+language&c=4&s=126&.sig=PZAexF9LyXpKb3HDJS > > > lB > > > > 1g> > > > > > > > > ________________________________ > > > > > > > > YAHOO! GROUPS LINKS > > > > > > > > > > > > > > > > * Visit your group "AspClassicAnyQuestionIsOk > > > > <http://groups.yahoo.com/group/AspClassicAnyQuestionIsOk> " on > > the > > > web. > > > > > > > > * To unsubscribe from this group, send an email to: > > > > [EMAIL PROTECTED] > > > > <mailto:[EMAIL PROTECTED] > > > subject=Un > > > > subscribe> > > > > > > > > * Your use of Yahoo! Groups is subject to the Yahoo! Terms > of > > > > Service <http://docs.yahoo.com/info/terms/> . > > > > > > > > > > > > ________________________________ > > > > > > > > > > > > > > > > > > > > [Non-text portions of this message have been removed] > > > > > > > > > > > > > > > > > > > > > > > > > > > > SPONSORED LINKS > > > Basic programming language > > > <http://groups.yahoo.com/gads? > > t=ms&k=Basic+programming+language&w1=Basic > > > > > > +programming+language&w2=Computer+programming+languages&w3=Programming > > +l > > > > > > anguages&w4=Java+programming+language&c=4&s=126&.sig=bnac3LCZpttb3c9Fv > > bV > > > U-A> Computer programming languages > > > <http://groups.yahoo.com/gads? > > t=ms&k=Computer+programming+languages&w1=B > > > > > > asic+programming+language&w2=Computer+programming+languages&w3=Program > > mi > > > > > > ng+languages&w4=Java+programming+language&c=4&s=126&.sig=1Czd2hKCO9_u4 > > KV > > > ZQperFQ> Programming languages > > > <http://groups.yahoo.com/gads? > > t=ms&k=Programming+languages&w1=Basic+prog > > > > > > ramming+language&w2=Computer+programming+languages&w3=Programming+lang > > ua > > > > > > ges&w4=Java+programming+language&c=4&s=126&.sig=TyHGCjod4YOKITrSq1xccQ > > > > > > > > > Java programming language > > > <http://groups.yahoo.com/gads? > > t=ms&k=Java+programming+language&w1=Basic+ > > > > > > programming+language&w2=Computer+programming+languages&w3=Programming+ > > la > > > > > > nguages&w4=Java+programming+language&c=4&s=126&.sig=PZAexF9LyXpKb3HDJS > > lB > > > 1g> > > > > > > ________________________________ > > > > > > YAHOO! GROUPS LINKS > > > > > > > > > > > > * Visit your group "AspClassicAnyQuestionIsOk > > > <http://groups.yahoo.com/group/AspClassicAnyQuestionIsOk> " on > the > > web. > > > > > > * To unsubscribe from this group, send an email to: > > > [EMAIL PROTECTED] > > > <mailto:[EMAIL PROTECTED] > > subject=Un > > > subscribe> > > > > > > * Your use of Yahoo! Groups is subject to the Yahoo! Terms of > > > Service <http://docs.yahoo.com/info/terms/> . > > > > > > > > > ________________________________ > > > > > > > > > > > > > > > [Non-text portions of this message have been removed] > > > > > > > > > > > > > > > > > ________________________________ > > > > YAHOO! GROUPS LINKS > > > > > > * Visit your group "AspClassicAnyQuestionIsOk > > <http://groups.yahoo.com/group/AspClassicAnyQuestionIsOk> " on the > web. > > > > * To unsubscribe from this group, send an email to: > > [EMAIL PROTECTED] > > <mailto:[EMAIL PROTECTED] > subject=Un > > subscribe> > > > > * Your use of Yahoo! Groups is subject to the Yahoo! Terms of > > Service <http://docs.yahoo.com/info/terms/> . > > > > > > ________________________________ > > > > > > > > > ________________________________ > > YAHOO! GROUPS LINKS > > > > * Visit your group "AspClassicAnyQuestionIsOk > <http://groups.yahoo.com/group/AspClassicAnyQuestionIsOk> " on the web. > > * To unsubscribe from this group, send an email to: > [EMAIL PROTECTED] > <mailto:[EMAIL PROTECTED] subject=Un > subscribe> > > * Your use of Yahoo! Groups is subject to the Yahoo! Terms of > Service <http://docs.yahoo.com/info/terms/> . > > > ________________________________ > > > > > [Non-text portions of this message have been removed] > SPONSORED LINKS Basic programming language <http://groups.yahoo.com/gads?t=ms&k=Basic+programming+language&w1=Basic +programming+language&w2=Computer+programming+languages&w3=Programming+l anguages&w4=Java+programming+language&c=4&s=126&.sig=bnac3LCZpttb3c9FvbV U-A> Computer programming languages <http://groups.yahoo.com/gads?t=ms&k=Computer+programming+languages&w1=B asic+programming+language&w2=Computer+programming+languages&w3=Programmi ng+languages&w4=Java+programming+language&c=4&s=126&.sig=1Czd2hKCO9_u4KV ZQperFQ> Programming languages <http://groups.yahoo.com/gads?t=ms&k=Programming+languages&w1=Basic+prog ramming+language&w2=Computer+programming+languages&w3=Programming+langua ges&w4=Java+programming+language&c=4&s=126&.sig=TyHGCjod4YOKITrSq1xccQ> Java programming language <http://groups.yahoo.com/gads?t=ms&k=Java+programming+language&w1=Basic+ programming+language&w2=Computer+programming+languages&w3=Programming+la nguages&w4=Java+programming+language&c=4&s=126&.sig=PZAexF9LyXpKb3HDJSlB 1g> ________________________________ YAHOO! GROUPS LINKS * Visit your group "AspClassicAnyQuestionIsOk <http://groups.yahoo.com/group/AspClassicAnyQuestionIsOk> " on the web. * To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED] subscribe> * Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service <http://docs.yahoo.com/info/terms/> . ________________________________ [Non-text portions of this message have been removed] ------------------------ Yahoo! Groups Sponsor --------------------~--> Get Bzzzy! (real tools to help you find a job). Welcome to the Sweet Life. http://us.click.yahoo.com/A77XvD/vlQLAA/TtwFAA/saFolB/TM --------------------------------------------------------------------~-> Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/AspClassicAnyQuestionIsOk/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
