Results 1 to 7 of 7
  1. #1
    printsol is offline Advanced Beginner
    Windows 10 Access 2010 64bit
    Join Date
    Sep 2021
    Posts
    33

    Query help


    hi dudes
    i m learner and newbie can any body help me
    i need a query to get data from attendance sheet i am attaching excel file and output(required) table sample

    Thanks
    Attached Thumbnails Attached Thumbnails decemberTbl.jpg  
    Attached Files Attached Files

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,898
    Link or import spreadsheet. Fields will possibly all be text type and will have to convert date and time values.

    Query1: qryINOUT

    SELECT TimeSheets.Name & ":IN" AS IN_OUT, CDate([Date]) AS Dte, Min(CDate([Time])) AS Data
    FROM TimeSheets
    WHERE (((TimeSheets.Status)="C/IN"))
    GROUP BY TimeSheets.Name, CDate([Date]);
    UNION SELECT TimeSheets.Name & ":Out", CDate([Date]) AS Dte, Max(CDate([Time])) AS Data
    FROM TimeSheets
    WHERE (((TimeSheets.Status)="C/Out"))
    GROUP BY TimeSheets.Name, CDate([Date]);

    Query2:

    TRANSFORM First(qryINOUT.Data) AS FirstOfData
    SELECT qryINOUT.Dte
    FROM qryINOUT
    GROUP BY qryINOUT.Dte
    PIVOT qryINOUT.IN_OUT;
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    printsol is offline Advanced Beginner
    Windows 10 Access 2010 64bit
    Join Date
    Sep 2021
    Posts
    33
    is there any way to change field data type in linked sheet?

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,898
    If you format Excel sheet cells as date and time, Access should recognize them as date/time type and CDate() would not be needed.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    printsol is offline Advanced Beginner
    Windows 10 Access 2010 64bit
    Join Date
    Sep 2021
    Posts
    33
    Thanks alot i vll try this

  6. #6
    printsol is offline Advanced Beginner
    Windows 10 Access 2010 64bit
    Join Date
    Sep 2021
    Posts
    33

    Search Through Name

    Quote Originally Posted by June7 View Post
    If you format Excel sheet cells as date and time, Access should recognize them as date/time type and CDate() would not be needed.
    Thanks dear
    query is working fine
    let me know if there is any way to search by name through form?
    if i want only specific person then how can it possible

    thanks

  7. #7
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,898
    I suppose could have dynamic parameter in either query that references a control such as a combobox on form. Because a CROSSTAB is involved, will have to use PARAMETERS clause. Review:

    http://allenbrowne.com/ser-67.html#Param
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

Please reply to this thread with any new information or opinions.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums