Find Jobs
Hire Freelancers

SQL build timesheet time ranges from a lookup start and Hrs

$30-150 USD

Complété
Publié il y a environ 14 ans

$30-150 USD

Payé lors de la livraison
Background: A table contains timesheet records with a Start and Finish time – like the first record below. Unfortunately, many records don’t record the times, only the amounts of hours (hrbk is Hours Booked – eg. One and a half hrs in the 3rd record). Task: Write SQL2008 Stored Proc to complete the Start and Finish times for those records with nulls. Each Worker is assigned an Attendance record to declare what they should be doing that day. Use that to determine the first Start time of the day, then build up the Finish time from the number of hours. Eg. The second timesheet shown (unique ROWSTAMP 435068320) needs to have Start and Finish times assigned. Their earliest Attendance record for that day shows a 7:30 Start, so that can be assigned together with the datediffed 1 hour (hrbk) which would make an 8:30 Finish time. The next record for this worker is on the same day so must continue – so ROWSTAMP 435069339 will Start at 8:30 and Finish at 10:00 (1.5 hrs). Don’t worry about lunchtimes for now – all times can be continuous with no breaks. It’s unlikely that the times will go past midnight – leave them null if so. Note, you will likely need to use some kind of temporary table – use a Table Variable rather than a #table, as they don’t mess up in memory so easily. The timesheet table has a new default 0 field at the end called UpdatedNullTimes = use this to flag 1 that it is to be processed and 2 that it has been processed. 3 can be used to show any problem with it. Write the SQL as a Stored Procedure that can be called to process any records (UpdatedNullTimes = 1) not already done (UpdatedNullTimes = 2). This script: select TSM.Pay_Ref, [login to view URL], [login to view URL], [login to view URL], [login to view URL], [login to view URL], A.Att_Pattern_ID, A.st_date from tbl_Timesheet_Maximo TSM inner join tbl_attend A on A.Pay_Ref = TSM.Pay_Ref and [login to view URL] = [login to view URL] --where [login to view URL] is null or [login to view URL] is null order by TSM.Pay_Ref, A.st_date, A.Att_Pattern_ID … should give you the following (should be line by line if you paste into Word, email etc but have put into .xls attched as will probably be messed up on publishing on site): Pay_Ref ROWSTAMP JDate Sttime Fntime hrbk Att_Pattern_ID st_date ------- ----------- ----------------------- ----------------------- ----------------------- --------------------------------------- -------------- ----------------------- J01464 430675274 2009-01-05 00:00:00.000 2009-01-05 07:30:00.000 2009-01-05 11:30:00.000 4.00 3 2009-01-05 07:30:00.000 J01464 435068320 2009-01-07 00:00:00.000 NULL NULL 1.00 3 2009-01-07 07:30:00.000 J01464 435069339 2009-01-07 00:00:00.000 NULL NULL 1.50 3 2009-01-07 07:30:00.000 J01464 435069990 2009-01-07 00:00:00.000 NULL NULL 1.00 3 2009-01-07 07:30:00.000 J01464 435112099 2009-01-07 00:00:00.000 NULL NULL 1.50 3 2009-01-07 07:30:00.000 J01464 435112242 2009-01-07 00:00:00.000 NULL NULL 1.00 3 2009-01-07 07:30:00.000 J01464 435112496 2009-01-07 00:00:00.000 NULL NULL 1.50 3 2009-01-07 07:30:00.000 J01464 435112842 2009-01-07 00:00:00.000 NULL NULL 1.50 3 2009-01-07 07:30:00.000 J01464 449318687 2009-01-07 00:00:00.000 NULL NULL 2.00 3 2009-01-07 07:30:00.000 J01464 435114670 2009-01-09 00:00:00.000 NULL NULL 2.00 3 2009-01-09 07:30:00.000 J01464 435114738 2009-01-09 00:00:00.000 NULL NULL 5.00 3 2009-01-09 07:30:00.000 J01464 433252608 2009-01-09 00:00:00.000 NULL NULL 2.00 3 2009-01-09 07:30:00.000 J01464 435264519 2009-01-12 00:00:00.000 2009-01-12 07:30:00.000 2009-01-12 16:30:00.000 9.00 3 2009-01-12 07:30:00.000 J01464 435741715 2009-01-13 00:00:00.000 NULL NULL 4.50 3 2009-01-13 07:30:00.000 J01464 435746205 2009-01-13 00:00:00.000 NULL NULL 4.50 3 2009-01-13 07:30:00.000 Notes: Will give copy of DB .bak to successful bidder. you should have SQL2008 DEVELOPER/STANDARD edition, not Express, but let me know if latter as may be able to transfer into an Express Instance. This should take around 4 hours to understand, write and test if you have experience of temp table iterative updates. It would take less than 1 hour if it was straight updates, but you need to build each set of records per worker's day as above, that's why it's more tricky (but not rocket science). The code should be fast and as easy to debug as possible (ie can adjust code in future). Comment it reasonably too (just enough to add value, no need to state the obvious).
N° de projet : 679562

Concernant le projet

9 propositions
Projet à distance
Actif à il y a 14 ans

Cherchez-vous à gagner de l'argent ?

Avantages de faire une offre sur Freelancer

Fixez votre budget et vos délais
Soyez payé pour votre travail
Surlignez votre proposition
Il est gratuit de s'inscrire et de faire des offres sur des travaux
Décerné à :
Avatar de l'utilisateur
I can do this within a day. Will provide a readable stored procedure, properly commented, and with good performance.
$50 USD en 1 jour
4,5 (1 commentaire)
1,4
1,4
9 freelances proposent en moyenne $130 USD pour ce travail
Avatar de l'utilisateur
Hello, please see PMB
$160 USD en 1 jour
5,0 (28 commentaires)
6,1
6,1
Avatar de l'utilisateur
I am Microsoft Certified Professional (MCP ID: 5489671) and Bachelor in Computer Science. I can start tomorrow.
$200 USD en 2 jours
4,5 (1 commentaire)
4,0
4,0
Avatar de l'utilisateur
Please read private message to follow...
$180 USD en 2 jours
5,0 (4 commentaires)
3,2
3,2
Avatar de l'utilisateur
Can do this quick.
$30 USD en 0 jour
0,0 (0 commentaires)
0,0
0,0
Avatar de l'utilisateur
Experienced Microsoft development house - No problem with delivering this solution
$200 USD en 1 jour
0,0 (0 commentaires)
0,0
0,0
Avatar de l'utilisateur
Please read my PM
$150 USD en 2 jours
0,0 (0 commentaires)
1,4
1,4
Avatar de l'utilisateur
Hi, Please check your PMB. Thanks, Manoj.
$100 USD en 4 jours
0,0 (1 commentaire)
0,0
0,0
Avatar de l'utilisateur
There is very interesting project for us. We are specializing in this kind of work. Our team of DBA experts has done many similar projects and we can do this one above your expectations extremely quickly with high quality. Please, read PMB for important information.
$100 USD en 1 jour
0,0 (0 commentaires)
0,0
0,0

À propos du client

Drapeau de UNITED KINGDOM
London, United Kingdom
5,0
2
Membre depuis mai 16, 2008

Vérification du client

Merci ! Nous vous avons envoyé un lien par e-mail afin de réclamer votre crédit gratuit.
Une erreur a eu lieu lors de l'envoi de votre e-mail. Veuillez réessayer.
Utilisateurs enregistrés Total des travaux publiés
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Chargement de l'aperçu
Permission donnée pour la géolocalisation.
Votre session de connexion a expiré et vous avez été déconnecté. Veuillez vous connecter à nouveau.