•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the ASP.NET section within the Web Development category of DaniWeb, a massive community of 402,097 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,508 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our ASP.NET advertiser: Lunarpages ASP Web Hosting
Views: 408 | Replies: 1
![]() |
•
•
Join Date: Jan 2008
Posts: 13
Reputation:
Rep Power: 1
Solved Threads: 0
Here is my mysql table need retrieve data
total table
MPN AML Onhand Demand
2 P 300 200
2 A 300 200
3 P 100 200
3 A 300 200
4 A 200 300
here is my output need
output
MPN AML Onhand Demand
2 P 300 200
3 A 300 200
How to retrieve data from total table that output result i need
here is my condition alway take aml type P is priority
if Ohand > demand then
show aml type P data
else
then take aml type A to compare
if aml type A Ohand >demand then
show aml type A data
else ignore it don't show aml type A and P
like output i need
i have tired before but it only appear aml type either A or P data
i am using mysql database store
how to appear aml type A and P simultaneous data that output table i show
Any 1 can show me solution with vb.net ??helpful appreciated
thx
total table
MPN AML Onhand Demand
2 P 300 200
2 A 300 200
3 P 100 200
3 A 300 200
4 A 200 300
here is my output need
output
MPN AML Onhand Demand
2 P 300 200
3 A 300 200
How to retrieve data from total table that output result i need
here is my condition alway take aml type P is priority
if Ohand > demand then
show aml type P data
else
then take aml type A to compare
if aml type A Ohand >demand then
show aml type A data
else ignore it don't show aml type A and P
like output i need
i have tired before but it only appear aml type either A or P data
i am using mysql database store
how to appear aml type A and P simultaneous data that output table i show
Any 1 can show me solution with vb.net ??helpful appreciated
thx
Newbie for programming
•
•
Join Date: Sep 2007
Posts: 1,057
Reputation:
Rep Power: 3
Solved Threads: 61
You can do this through vb.net or you can do it through your SQL query.
If you are not going to use a stored procedure, I would recommend sorting through it from your code, and just selecting all of what you need.
Just call the function everytime you need the data.
If you are not going to use a stored procedure, I would recommend sorting through it from your code, and just selecting all of what you need.
SELECT * FROM tbl
<script language="vb" runat="server">
Function chkArgs(ByVal mpn As Short, ByVal aml As Char, ByVal onhand As Integer, ByVal demand As Integer)
If aml = "P" And onhand >= demand Then
'Do your data here
ElseIf aml = "A" And onhand >= demand Then
'Do your data here
End If
End Function
</script>chkArgs(<%# Eval("mpn") %>,<%# Eval("aml") %>,<%# Eval("onhand") %>,<%# Eval("demand") %>) I answer pm's.
I answer questions.
I answer quickly.
I answer.
I answer questions.
I answer quickly.
I answer.
![]() |
•
•
•
•
•
•
•
•
DaniWeb ASP.NET Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
- Previous Thread: How to retrieve records from the database one at a time?
- Next Thread: how to get the datas when the dropdown list has only one value.



Linear Mode