I have a sql table containing GBP prices and I was wondering if there is a way to pull out these prices, convert them to EURO prices and then to display them on a webpage as EURO prices?
is this even possible?
p.s I dont have a problem pulling out the prices using asp/sql - I just need to know if they can be converted and pulled out as I would prefer to avoid creating multiple tables.
my code -
<%
-
'DISPLAY PRICES
-
DIM objConn19and20
-
Set objConn19and20 = MYCONNGOESHERE
-
-
DIM FLIGHTROUTES19and20
-
FLIGHTROUTES19and20 = "SELECT * FROM MYTABLENAMEGOESHERE
-
-
DIM objRS19and20
-
Set objRS19and20 = MYCONNGOESHERE
-
-
If objRS19and20.Eof Then
-
'This checks to see if we are at end of file (eof) for the returned recordset
-
'if we are there were no records we tell them that
-
Response.write "<div align='center'>Sorry there are no current records.</div>"
-
Else
-
-
Response.Write "<table align=""center"" id=""flightspecialscontainer"" cellpadding=""0"" cellspacing=""0"">"
-
Response.Write "<tr><td>"
-
-
'start a loop that will go until the eof
-
Do while not objRS19and20.Eof
-
-
'if there were records lets do something with them
-
'write some table setup
-
Response.Write "<table align=""center"" cellpadding=""0"" cellspacing=""0"" id=""flightspecialroutetable"">"
-
Response.Write "<tr><td>" & objRS19and20("Anchor_Tag") & vbCrLf & "<fieldset class=""fieldsetspecialpricebox"">" & vbCrLf
-
Response.Write "<legend>" & vbCrLf & "<span class=""specialtitlesmall"">" & objRS19and20("Flight_Route") & "</span>" & vbCrLf & "</legend>" & vbCrLf
-
Response.Write "<table align=center cellpadding=0 cellspacing=0 class=""specialpricetable"">" & vbCrLf
-
Response.Write "<tr>" & vbCrLf & "<td class=""priceheadertd"">Price</td>" & vbCrLf
-
Response.Write "<td class=""dateheadertd"">Outbound Date/s</td></tr>" & vbCrLf
-
Response.Write "<tr><td colspan=2 height=10> </td></tr>" & vbCrLf
-
-
'write your table content
-
Response.Write "<tr>" & vbCrLf & "<td class=""pricetd"">£" & objRS19and20("Price_Band_1") & "</td>" & vbCrLf
-
Response.Write "<td class=""datetd""><span class=""monthspan"">" & objRS19and20("Month_Band_1") & " </span>" & objRS19and20("Date_Band_1") & "</td>" & vbCrLf & "</tr>" & vbCrLf
-
Response.Write "<tr>" & vbCrLf & "<td class=""pricetd"">£" & objRS19and20("Price_Band_2") & "</td>" & vbCrLf
-
Response.Write "<td class=""datetd""><span class=""monthspan"">" & objRS19and20("Month_Band_2") & " </span>" & objRS19and20("Date_Band_2") & "</td>" & vbCrLf & "</tr>" & vbCrLf
-
Response.Write "<tr>" & vbCrLf & "<td class=""pricetd"">£" & objRS19and20("Price_Band_3") & "</td>" & vbCrLf
-
Response.Write "<td class=""datetd""><span class=""monthspan"">" & objRS19and20("Month_Band_3") & " </span>" & objRS19and20("Date_Band_3") & "</td>" & vbCrLf & "</tr>" & vbCrLf
-
Response.Write "<tr>" & vbCrLf & "<td class=""pricetd"">£" & objRS19and20("Price_Band_4") & "</td>" & vbCrLf
-
Response.Write "<td class=""datetd""><span class=""monthspan"">" & objRS19and20("Month_Band_4") & " </span>" & objRS19and20("Date_Band_4") & "</td>" & vbCrLf & "</tr>" & vbCrLf
-
-
'end table setup
-
Response.Write "<td colspan=""2"" class=""specialbookbuttontd""><a class=""button"" href=""#BackToTop"" onClick=""change_booking(" & objRS19and20("Book_Button") & ")"">BOOK NOW !</a></td>"
-
Response.Write "</tr>" & vbCrLf & "</table>" & vbCrLf & "</fieldset>" & vbCrLf
-
Response.Write "</td></tr></table>" & vbCrLf & vbCrLf
-
-
'move to the next record in the recordset
-
objRS19and20.movenext
-
-
Loop
-
-
end if
-
-
'close out your table
-
Response.Write "</td>" & vbCrLf & "</tr>" & vbCrLf & "</table>" & vbCrLf
-
-
objRS19and20.Close
-
Set objRS19and20 = Nothing
-
objConn19and20.Close
-
Set objConn19and20 = Nothing
-
%>
-
thanks in advance,
Omar.
5 2655
Hi, you need to write a function either at your backend application or in your frontend application that will convert the INR to EURO.
e.g. 1 Indian rupee = 0.0164715581 Euros (As per 26th March, 2010).
Since we know that, the denomination does not always remain constant, so according to me kindly find a web service and consume that from your client application. So that you don't have to worry about the exact rate when there will be a fluctuation in denomination.
I found some for you . Have a look
a) CurrencyConvertor
b) Noon Foreign Exchange Rates Web Service
Hope this will help you
hey nbiswas
thanks for your reply. i understand what you are saying although i think i need to focus on how to convert the gbp to euro from the front end side for now.
a backend web services integration can be step 2 although i agree with an automated web services feeding the latest currency conversion rate : ) thank you for providing the 2 examples of web services/currency converters but I need to speak to my superiors regarding their sources of currency exchange but thats step 2.
could you advise how I could perform a simple conversion on the front end from the sql statement please?
my table is something like this ID.....Route........................Month......Dat e_Band_1.......Price_Band_1
1..........Gatwick to Toronto.....March.......13,14..................... .449
thanks in advance
regards
Omar.
We know that, 1 British pound (GBP)= 1.11541632 Euros (March 26th, 2010)
So the select query will be
select Id, Route,Month,Date,Band_1, EuroPrice = Cast( Price_Band_1 * 1.11541632 as Varchar(100)) + space(1) + 'Euros' from tblInfo
thanks - I've got this error 'Arithmetic overflow error converting varchar to data type numeric.' when I used -
select ID, Price_Band_3 = Cast( Price_Band_3 * 1.11541632 as Varchar(50)) from TABLENAME WHERE ID='1'
-
although this works -
select ID, Price_Band_3 = Cast( Price_Band_3 * 2 as int) from TABLENAME WHERE ID='1'
-
not sure why im getting an error as Price_Band_3 = 109 on ID=1 on my table?
i still have this error .. can anyone help please?
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Chris |
last post by:
Hi,
I am going to be difficult here... How do I retrieve one row at a
time from a table without using a cursor?
For example, I have a table with 100 rows. I want to retrieve the
data from...
|
by: Willing 2 Learn |
last post by:
I'm still having trouble getting my program to do arithmetic in
cents(keeping all #'s) then convert the answer in a format of dollars &
cents. The main program should add, subtract, scalar...
|
by: digitalavatar |
last post by:
I am having a problem with my Access 2000 front end to a SQL 7 or 2000
database. I create a table in SQL with a field named, say, amt, data
type MONEY. When I link the table in Access using ODBC,...
|
by: Manuel Canas |
last post by:
Hi there,
I have a form with a couple of tabs on in and I'm filling the form from a
dataset with the fill method. I am using a currency manager for binding
controls with a datatable....
|
by: Manuel Canas |
last post by:
I'm stuck here guys, need some help.
I have a form with a couple fo tabs on it. I load a table in each for each
tab. I populate a listbox with a list of names. Then I use currency manager
to...
|
by: sck10 |
last post by:
Hello,
I have a SQL Server 2K table with a field set to currency. When I try to
insert or update a FormView, I get the following error:
Disallowed implicit conversion from data type nvarchar...
|
by: kev |
last post by:
Hi all,
I have created a database for equipments. I have a form to register the
equipment meaning filling in all the particulars (ID, serial, type,
location etc). I have two buttons at the end...
|
by: xjohnx |
last post by:
Hi, I'm hoping someone can help me I am quite new to Javascript and have had to create a programme which converts dollars into euros and vice versa, here is my script which is working
var...
|
by: =?Utf-8?B?RGVuaXMgU29oZXQ=?= |
last post by:
Hi all,
I've created a new project to test ObjectDataSource component.
I've just added a new objectdatasource, configured it (linked to a table)
etc ...
It works fine on localhost, i can...
|
by: mereba |
last post by:
Hello
My country Ghana is changing its currency. I want to write a small
programme in C++ that can covert from the old currency into the new
one. I would like this programme to run behind a simple...
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The...
| |