Database name : bd1
Table Name : schedule
Fields : associate_name, Category, Aux, Time
Raj ABC Login, 9:00:00
Raj ABC Logout 6:00:00
i want the below output
associate_name, Category, Aux, Login Time, Logout Time
Raj ABC Login 9:00:00 6:00:00
Please help me out.. im new to this.
Raj.
Join the table to itself. You will need a ranking column also so that you can join to the next row.
15 2081
Join the table to itself. You will need a ranking column also so that you can join to the next row.
first in a table make one column as a primary key and den use it in another table as a foreign key then it will b easy to retrieve data
@syed, that won't work. We are only talking about one table here, not two.
HI guys Please help me out. i wanted to implement this ASAP in my company without ur help i won't be able to do this
Hi, can you guys show me the SQl statement to retrieve the data in single table as i have shown above ?
This is not a code writing service but if you make an attempt and post your SQL along with a description of the problem with the code, we can help guide you to a solution.
the problem i have mentioned above is not enough ? is that what you are saying. and i have not asked you guys to write a code for me. im just asking how can i get the two set of data in a single line. please go through the question clearly... its a request
single table ... then might be possible try using procedure ...
with if statement ...
if this
begin
bla bla bla
end
else
begin
bla bla bla
end
--------
hope by this u ill get some gelp
The question you have asked is fine. The problem is that you have asked for code. In post number 6, you said:
can you guys show me the SQl statement to retrieve the data in single table as i have shown above
That is asking for code. We are not here to do your work for you. We will gladly guide you along as you attempt the code, but you have to make an initial attempt at it. I have already supplied the method you can use in post #2.
Okay here is the code i have written : - <%
-
Dim objRS001, objrs002
-
-
'Defining connection string, specify database driver and location of the database
-
sConnection = "DRIVER={MySQL ODBC 5.1 Driver};Server=localhost;Database=homeshop18;Uid=root;Pwd=cfa;"
-
Set ObjConn = Server.CreateObject("ADODB.Connection")
-
ObjConn.Open(sConnection)
-
-
SQLRAJU001 = "select Associate_name, Category, Date, Aux, Login_time from Schedule where Aux = 'Login' and Date >= '" & from_date & "' and Date <= '" & to_date &"' Group by Associate_name "
-
SQLRAJU002 = "select Associate_name, Category, Date, Logout_time from Schedule where Aux = 'Logout' and Date >= '" & from_date & "' and Date <= '" & to_date &"' Group by Associate_name "
-
-
Set objRS001 = ObjConn.Execute(SQLRAJU001)
-
Set objRS002 = ObjConn.Execute(SQLRAJU002)
-
-
%>
-
-
<p class="auto-style1"> </p>
-
<h2 class="auto-style13">Associate Attendence Report</h2>
-
-
<table cellspacing="1" class="auto-style2" style="width: 580px; float: left">
-
<tr>
-
<td class="auto-style15"><strong>Associate Name</strong></td>
-
<td class="auto-style15"><strong>Category</strong></td>
-
<td class="auto-style15"><strong>Date</strong></td>
-
<td class="auto-style15"><strong>Aux</strong></td>
-
<td class="auto-style15"><strong>Login Time</strong></td>
-
<td class="auto-style15"><strong>Logout Time</strong></td>
-
</tr>
-
<%
-
do while not objrs001.eof
-
%>
-
<%
-
do while not objrs002.eof
-
%>
-
<tr>
-
<td class="auto-style14"><%=objrs001("associate_name")%></td>
-
<td class="auto-style14"><%=objrs001("Category")%></td>
-
<td class="auto-style14"><%=objrs001("Date")%></td>
-
<td class="auto-style14"><%=objrs001("Aux")%></td>
-
<td class="auto-style14"><%=objrs001("Login_Time")%></td>
-
<td class="auto-style14"><%=objrs002("Logout_Time")%></td>
-
</tr>
-
<%
-
objrs001.movenext
-
Loop
-
objrs002.movenext
-
Loop
-
%>
-
<%
-
objrs001.close
-
objrs002.close
-
objconn.close
-
%>
-
</table>
this is not working ...
I don't know where this ASP code came out of all of a sudden. But since we're in the MySQL forum, the solution should be in MySQL only. So let's work only on the query. You'll need to create a query using the method in post 2.
easy way make one column as a unique identity with that unique you can retrieve the data what ever you want ..........
@syed, that won't work if there are ever gaps in the sequence. As would happen if they delete records. Having a unique id is a good idea. But they would still need to create a ranking column.
Thanks Everyone for you valuable time.. i could not reach to any conclusion.but im stopping this here. Since this is no code writing service i cannot take anymore help. Please dont spent ur time in replying.
zmbd 5,501
Expert Mod 4TB
I've taken the liberty of setting Rabbit's response as the best answer provided within the thread context based on OP's abandonment of the question and robustness of the solution offered.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Smith |
last post by:
I have a situation where I want to pull strings from one table of a SQL 2000
database and find matches for it in other tables of the same database and
have those values returned. i.e. In one...
|
by: Chris Tyson |
last post by:
I created an Access 97 database a while ago. It is protected by Workgroup
Security, and it is not split.
In order to compare different sets of results, a colleague has suggested
that it would be...
|
by: Alpha |
last post by:
Hi, I need to get the value for the 1st record (there is only one row in this
table at all time) for the column name LogFilePath. I got the ado.net and
the dataset fill and the table...
|
by: Tommy Christian |
last post by:
Hi!
Anyone who knows about saving serialized data to database,
coz I have a problem with that. If I just serialize my session data and
then deserialize it, it works. But when I save it...
|
by: =?Utf-8?B?c2NvdHRybQ==?= |
last post by:
Hi
I am using a SQL Server 2005 varbinary(max) to store word documents in the
database. I can retrive the data out into a MemoryStream object ok but I want
to be able to use this to display the...
|
by: rdawadiuk |
last post by:
hello professnols,
In my table I have, among other, two fileds "Activity" and "Accont ID". I
use form to fill the data in the table. If the field "activity " is either
"deposit" or withdraw"...
|
by: Amita Singh |
last post by:
Hi,
How to retrieve data from database in data table?
|
by: robin1983 |
last post by:
HI, I have a problem with sql query.. Actually, i have three different table eg. table1, table2, and table3. All the three table have same field name. Actually, my problem is that, whenever I insert...
|
by: Shalini Bhalla |
last post by:
can i make use of two different connection using different database in a same php file , if yes , then how
|
by: lifeisgreat20009 |
last post by:
I am a newbie to Struts and JSP...I have been working on the code below for 5 hours now..I googled a lot but couldn't get much help so finally I am here.. Hoping of getting my problem solved. Please...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: jfyes |
last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
|
by: ArrayDB |
last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
|
by: Defcon1945 |
last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
|
by: Shællîpôpï 09 |
last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
|
by: af34tf |
last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
| |