473,395 Members | 1,915 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

how can select

idsanjeev
241 100+
i have need help in sql Select stetements.
i am very confuse for a quary
my need to select first entry and last out datewise of all memeber that is stored in table and member is enter and out more than one time a day but i have to display perday first entery and last out between selected months
Feb 12 '08 #1
5 1275
amitpatel66
2,367 Expert 2GB
i have need help in sql Select stetements.
i am very confuse for a quary
my need to select first entry and last out datewise of all memeber that is stored in table and member is enter and out more than one time a day but i have to display perday first entery and last out between selected months
I assume you are looking for something like this:

Expand|Select|Wrap|Line Numbers
  1.  
  2. SELECT x.member_name FROM table x WHERE (x.date_logged_in,x.logged_out) = (SELECT MIN(logging_time),MAX(logging_time) FROM table WHERE member_name = x.member_name)
  3.  
  4.  
The login and logout details are refering to same column in the table?
Feb 12 '08 #2
debasisdas
8,127 Expert 4TB
Are you working on something like an attendance register ?
Feb 12 '08 #3
idsanjeev
241 100+
Hi debasisdas
Yes you are right i am woking on attance system.
i am using two table thats is let me try to define
my table name is acs_data and its field is empno,opdate,optime,ioflg,cardno,seqno
empno is no of member, opdate is date optime is time ioflg is i for in and o for out card no is both side of door that is encoded i or o and othe tbale is emptable where empno, empname,
designame and i have to display all employee records/perday with maximum out and minimum in time
thanks
Feb 13 '08 #4
idsanjeev
241 100+
Thanks
by using this i am getting the result thats are required
Expand|Select|Wrap|Line Numbers
  1. Set RS3=CON.Execute(" SELECT a.EMPNO,a.seqno,TO_CHAR(a.OPDATE,'DD-Mon-YYYY') OPDATE , b.dscr,a.optime,a.ioflg,a.PNCH_FLG FROM ACS_DATA a, M_CARD b WHERE a.cardno = b.readerno AND EMPNO IN (SELECT EMPNO FROM M_FIX_EMPLOYEE@alf2 WHERE opdate>= '15-jan-2008' AND opdate <='25-jan-2008' AND DEPT_CD = 124) AND  ( seqno = 1 OR seqno = (SELECT MAX(seqno) FROM ACS_DATA WHERE empno = a.empno AND opdate = a.opdate) ) ORDER BY empno")
i have need another type of help for read date of previous months if current months is feb than select jan like 1-jan-2008 if case is not jan always select day from 1 months prev year current
thanks
Feb 13 '08 #5
idsanjeev
241 100+
hello
Thanks i got it working thats my need
thanks again
for nice support
Feb 13 '08 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: JT | last post by:
I have an input form for which I've created a "matrix" for user input. Basically, the user chooses a radio button and then through javascript, a select box is displayed to define a value for that...
4
by: Elroyskimms | last post by:
Using SQL 2000... tblCustomer: CustomerID int CompanyName varchar(20) HasRetailStores bit HasWholesaleStores bit HasOtherStores bit tblInvoiceMessages:
4
by: bobsawyer | last post by:
I've been building a series of SELECT lists that are populated dynamically using HTTPRequest. Things are going pretty well, and I've got the whole thing working flawlessly in Mozilla/Firebird....
3
by: dumbledad | last post by:
Hi All, I'm confused by how to replace a SELECT statement in a SQL statement with a specific value. The table I'm working on is a list of words (a column called "word") with an index int...
10
by: serge | last post by:
Using "SELECT * " is a bad practice even when using a VIEW instead of a table? I have some stored procedures that are identical with the difference of one statement in the WHERE clause. If I...
1
by: serena.delossantos | last post by:
Trying to insert into a history table. Some columns will come from parameters sent to the store procedure. Other columns will be filled with a separate select statement. I've tried storing the...
9
chunk1978
by: chunk1978 | last post by:
hey everyone, i've been trying to solve this problem for 2 days straight, with no end in sight. i would greatly appreciate anyone's help. EXPLANATION: There are 3 Select Menus. The 1st and...
2
by: naima.mans | last post by:
Hello, i want to select 2 following brothers nodes wich are one under another (one closed to another)... i have done one xslt file... but it's not really good.. for example: the xml file:...
4
by: rn5a | last post by:
A Form has 2 select lists. The 1st one whose size is 5 (meaning 5 options are shown at any given time) allows multiple selection whereas the 2nd one allows only 1 option to be selected at a time. ...
6
by: Apaxe | last post by:
In the database i have a table with this information: key_id =1 key_desc =43+34+22+12 I want sum the values in key_desc. Something like: SELECT key_desc FROM table But the result of...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
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...
0
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...
0
tracyyun
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.