|
Abhijit Jana wrote: can you cleary mention your table. I am not able to get it .
Look at this
Table Name Attributes<br />
ID 1<br />
qty1 1<br />
price1 20<br />
<br />
qty2 10<br />
prices 15<br />
<br />
qty3 50<br />
prices 10<br />
<br />
qty4 100<br />
prices 8<br />
<br />
qty5 200<br />
prices 6<br />
<br />
qty6 500<br />
prices 4
Now, If I enter qty=5,return prices 20 and 15 (qty 1 to 10)
for qty=75,return prices 10 and 8 (qty 50 to 100)
for qty=250,return prices 6 and 4 (qty 200 to 500)
and so on.....
got it.
Thanks
please don't forget to vote on the post that helped you.
|
|
|
|
|
Are qty1, qty2... qtyN and prices1, prices2... pricesN columns in your database?
|
|
|
|
|
Paddy Boyd wrote: Are qty1, qty2... qtyN and prices1, prices2... pricesN columns in your database?
No. thers are only 8 columns of qty and 8 columns of prices.
please don't forget to vote on the post that helped you.
|
|
|
|
|
I think that you should look at your DB design, for two reasons:
1. You are making this very hard to query for yourself.
2. It's not extensible - what happens if your customer wants to add another quantity band - you add another column and update any sql??
I would suggest that you have a table with your ID (I'm guessing that it's a product table) and then another table like this:
ProductID Quantity Price
Where ProductId and Quantity are the combined PK.
So for product 1 you might then have entries in the above table like:
ID Qty Price
1 10 20
1 30 40
1 40 50
And you then want the price for a band, the select statement would be as follows:
SELECT TOP 1 PRICE
FROM ThisTable
WHERE ID = 1
AND Quantity < 15
ORDER BY Quantity DESC
|
|
|
|
|
try something like this
select Price from Tablename
where qty =(select top 1 qty from TableName where qty<=5) or
qty =(select top 1 qty from TableName where qty>5)
|
|
|
|
|
hi imran try this
select price from attributes where qty in (select Max(qty) as qty from attributes where qty < EnterValue) Or (select Min(qty) as qty from attributes where qty > EnterValue)
harun
|
|
|
|
|
just try this query
select price from attributes where qty in (select Max(qty) as qty from attributes where qty < EnterValue) Or qty in (select Min(qty) as qty from attributes where qty > EnterValue)
harun
|
|
|
|
|
Hi,
I am doing work on a web application in asp.net 1.1. Client want me to place button on web form named as "Burn CD". In simple word he want to burn cd in web application. Let us suppose there is a file on web server. He want to burn that file on CD. Is it possible. Please do help me. If it is not possible then please give me any reference. Thanks in advance.
Arslan Ilyas
.Net Developer
Red Signal
|
|
|
|
|
It's not possible to do for normal public website. (All web developers know that due to the security reason, it's not possible to access the client's system from website.)
But if your client added your website in trust websites and you are also using ActiveX or flash then it is possible.
|
|
|
|
|
I understand. But, if i want to burn cd on web server not on client then its possible or not. If you have any article or link to article then please let me know. Thanks again.
|
|
|
|
|
arslanjatt wrote: if i want to burn cd on web server not on client then its possible or not
The case doesn't make sense.
AND
It's not possible.
|
|
|
|
|
Michael Sync wrote: It's not possible.
I haven't used, but I think XPBurn[^]can do that.
|
|
|
|
|
Yeah indeed. But who's going to sit on the server and load all the CD's as required??
|
|
|
|
|
|
ya.
|
|
|
|
|
I told this guy days ago that XPBurn is how to do it, but that it's a totally retarded requirement. Judging by his asking over and over, I'd guess it's a rentacoder job, that's the only place I've ever found buyers clueless enough to ask for something like this.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Christian Graus wrote: his guy days ago that XPBurn is how to do it
Have you tried using XPBurn in ASP.NET application? I feel kinda strange about that. I have check the link given by Nav but I'm not able to find the ASP.NET sample for that. It would be great if you can tell me more about this.
|
|
|
|
|
Yes same for me too. I have not used it. I think some background worker stuff needed for doing this. Or the user has to wait till the burning finishes to load the page !
|
|
|
|
|
Thanks. I don't know about XPBurn.. I feel kinda strange for writing the CD from web application..
|
|
|
|
|
Well guys, don't mind. Act. it was requirement by client. I didn't done work with that but now i came to know that its not possible. Thanks any ways
|
|
|
|
|
It's always been possible, it's just stupid.
An ASP.NET page does have a limited lifecycle, but in that time it can kick off another process, which can burn a CD, no problem.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Client ask me to do on server side. They have their own server. So is there any solution to do that. Can i do it by calling a windows service from a web application. Please do help me. Thanks in advance
|
|
|
|
|
Hi Everybody,
I am working with classic ASP. In one of my webpage i forgot to close a recordset. This recordset contains good amount of data. And I found this mistake very late. I have currected it.
But I still want to
1) Is it affects on site speed?
2) How dose such mistakes affects Websites? What are the effects of such mistakes?
Kiran Sajanikar.
|
|
|
|
|
Kiran S. S. wrote: 1) Is it affects on site speed?
If you open tooo much of connection then it will affect on site speed. But the GC will clear the object that are no longer used for a particular time.
Kiran S. S. wrote: 2) How dose such mistakes affects Websites? What are the effects of such mistakes?
Opening a lot of connections makes your server tired.
|
|
|
|
|
Michael Sync wrote: But the GC will clear the object that are no longer used for a particular time.
He is saying about classic ASP not .NET. GC won't be available there.
|
|
|
|