Précédent   Forum des professionnels en informatique > Logiciels > Solutions d'entreprise > Business Intelligence > Crystal Reports
Crystal Reports Forum d'entraide sur Crystal Reports. Avant de poster --> FAQ Crystal, Tutoriels Crystal
Partagez cette discussion sur d'autres réseaux sociaux : Viadeo Twitter Google Facebook Digg Delicious MySpace Yahoo
Réponse Proposer ce sujet en actualité
 
Outils de la discussion
Publicité
'
Vieux 16/07/2007, 13h49   #1
Nouveau Membre du Club
 
Inscription : avril 2007
Messages : 59
Détails du profil
Informations forums :
Inscription : avril 2007
Messages : 59
Points : 27
Points : 27
Envoyer un message via MSN à battl14
Par défaut [CR XI] calcul de temps à partir d'un calendrier

Bonjour,

Je souhaite effectuer un calcul de temps de traitement d'un dossiers de support à partir d'un calendrier (jours et heures ouvrés). Je ne vois pas comment procéder. Si quelqu'un a un exemple d'utilisation de calendrier dans un état Crystal Reports XI?

Cordialement
battl14 est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 16/07/2007, 14h01   #2
Membre du Club
 
Inscription : avril 2007
Messages : 145
Détails du profil
Informations personnelles :
Localisation : Luxembourg

Informations forums :
Inscription : avril 2007
Messages : 145
Points : 44
Points : 44
Dans ton traitement de dossier de support, as-tu une date de création et de résolution?? Tu pourrais alors utiliser des formules...
campia est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 16/07/2007, 14h17   #3
Nouveau Membre du Club
 
Inscription : avril 2007
Messages : 59
Détails du profil
Informations forums :
Inscription : avril 2007
Messages : 59
Points : 27
Points : 27
Envoyer un message via MSN à battl14
C'est ce que je souhaite effectuer mais en me basant sur un calendrier qui prend en compte les jours et heures ouvrés ainsi que les jours fériés.
battl14 est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 23/07/2007, 10h42   #4
Membre expérimenté
 
Avatar de kikidrome
 
Inscription : décembre 2004
Messages : 841
Détails du profil
Informations personnelles :
Localisation : France, Drôme (Rhône Alpes)

Informations forums :
Inscription : décembre 2004
Messages : 841
Points : 563
Points : 563
hello
j'ai fait quelque chose de ce style en utilisant une table access dans laquelle, je définissais les jours fériés.
Pour les samedi et dmanches, tu as
Citation:
DayOfWeek (date)
__________________
Les paysages sont plus beaux quand on transpire.
Olaf Candau
kikidrome est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 23/07/2007, 12h51   #5
Nouveau Membre du Club
 
Inscription : avril 2007
Messages : 59
Détails du profil
Informations forums :
Inscription : avril 2007
Messages : 59
Points : 27
Points : 27
Envoyer un message via MSN à battl14
Merci kikidrome,

Mais il faut aussi que je me base par rapport à une plage horaires,

Cordialement
Battl14
battl14 est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 08/08/2007, 13h29   #6
Nouveau Membre du Club
 
Inscription : avril 2007
Messages : 59
Détails du profil
Informations forums :
Inscription : avril 2007
Messages : 59
Points : 27
Points : 27
Envoyer un message via MSN à battl14
Par défaut Résolution

Bonjour,
Voici la formule que j'ai fait avec l'aide du support BO. Le developpement est un peu disgracieux mais il y a l'intergration des jours fériés jusqu'en 2014, les horaires d'ouvertures et les weekends
Code :
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
 
DatetimeVar FirstDateTime:= {dtOpened}; 
DatetimeVar LastDateTime:= {dtEnd}; 
TimeVar BusinessStartTime:= Time(09,00,00); 
TimeVar BusinessEndTime:= Time(18,00,00); 
 
DateVar NewYearsDay2007:=Date(2007,01,01);
DateVar LundiPaques2007:=Date(2007,04,09);
DateVar fetedutravail2007:=Date(2007,05,01);
DateVar victoire2007:=Date(2007,05,08);
DateVar Ascension2007:=Date(2007,05,17);
DateVar fetenat2007:=Date(2007,07,14);
DateVar Assomption2007:=Date(2007,08,15);
DateVar Toussaint2007:=Date(2007,11,01);
DateVar Armistice2007:=Date(2007,11,11);
DateVar Noel2007:=Date(2007,12,25);
 
DateVar NewYearsDay2008:=Date(2008,01,01);
DateVar LundiPaques2008:=Date(2008,03,24);
DateVar fetedutravail2008:=Date(2008,05,01);
DateVar victoire2008:=Date(2008,05,08);
DateVar fetenat2008:=Date(2008,07,14);
DateVar Assomption2008:=Date(2008,08,15);
DateVar Toussaint2008:=Date(2008,11,01);
DateVar Armistice2008:=Date(2008,11,11);
DateVar Noel2008:=Date(2008,07,04);
 
DateVar NewYearsDay2009:=Date(2009,01,01);
DateVar LundiPaques2009:=Date(2009,04,13);
DateVar fetedutravail2009:=Date(2009,05,01);
DateVar victoire2009:=Date(2009,05,08);
DateVar Ascension2009:=Date(2009,05,21);
DateVar fetenat2009:=Date(2009,07,14);
DateVar Assomption2009:=Date(2009,08,15);
DateVar Toussaint2009:=Date(2009,11,01);
DateVar Armistice2009:=Date(2009,11,11);
DateVar Noel2009:=Date(2009,12,25);
 
DateVar NewYearsDay2010:=Date(2010,01,01);
DateVar LundiPaques2010:=Date(2010,04,05);
DateVar fetedutravail2010:=Date(2010,05,01);
DateVar victoire2010:=Date(2010,05,08);
DateVar Ascension2010:=Date(2010,05,13);
DateVar fetenat2010:=Date(2010,07,14);
DateVar Assomption2010:=Date(2010,08,15);
DateVar Toussaint2010:=Date(2010,11,01);
DateVar Armistice2010:=Date(2010,11,11);
DateVar Noel2010:=Date(2010,12,25);
 
DateVar NewYearsDay2011:=Date(2011,01,01);
DateVar LundiPaques2011:=Date(2011,04,25);
DateVar fetedutravail2011:=Date(2011,05,01);
DateVar victoire2011:=Date(2011,05,08);
DateVar Ascension2011:=Date(2011,06,02);
DateVar fetenat2011:=Date(2011,07,14);
DateVar Assomption2011:=Date(2011,08,15);
DateVar Toussaint2011:=Date(2011,11,01);
DateVar Armistice2011:=Date(2011,11,11);
DateVar Noel2011:=Date(2011,12,25);
 
DateVar NewYearsDay2012:=Date(2012,01,01);
DateVar LundiPaques2012:=Date(2012,04,09);
DateVar fetedutravail2012:=Date(2012,05,01);
DateVar victoire2012:=Date(2012,05,08);
DateVar Ascension2012:=Date(2012,05,17);
DateVar fetenat2012:=Date(2012,07,14);
DateVar Assomption2012:=Date(2012,08,15);
DateVar Toussaint2012:=Date(2012,11,01);
DateVar Armistice2012:=Date(2012,11,11);
DateVar Noel2012:=Date(2012,12,25);
 
DateVar NewYearsDay2013:=Date(2013,01,01);
DateVar LundiPaques2013:=Date(2013,04,01);
DateVar fetedutravail2013:=Date(2013,05,01);
DateVar victoire2013:=Date(2013,05,08);
DateVar Ascension2013:=Date(2013,05,09);
DateVar fetenat2013:=Date(2013,07,14);
DateVar Assomption2013:=Date(2013,08,15);
DateVar Toussaint2013:=Date(2013,11,01);
DateVar Armistice2013:=Date(2013,11,11);
DateVar Noel2013:=Date(2013,12,25);
 
DateVar NewYearsDay2014:=Date(2014,01,01);
DateVar LundiPaques2014:=Date(2014,04,21);
DateVar fetedutravail2014:=Date(2014,05,01);
DateVar victoire2014:=Date(2014,05,08);
DateVar Ascension2014:=Date(2014,05,29);
DateVar fetenat2014:=Date(2014,07,14);
DateVar Assomption2014:=Date(2014,08,15);
DateVar Toussaint2014:=Date(2014,11,01);
DateVar Armistice2014:=Date(2014,11,11);
DateVar Noel2014:=Date(2014,12,25);
 
Numbervar HoursInADay:= (BusinessEndTime - BusinessStartTime)/3600;
Numbervar Days;
Numbervar Weekends;
Numbervar Finaldays;
DateVar StartDate;
DateVar EndDate;
NumberVar halfdays;
NumberVar fulldays;
NumberVar hours;
NumberVar Holidays:=0;
timevar TrueStartTime;
timevar TrueEndTime;
 
 
IF FirstDateTime <=Date(0,0,0) OR LastDateTime <=Date(0,0,0) then hours:= 0
 
ELSE
(
IF time(FirstDateTime) IN BusinessStartTime TO BusinessEndTime then 
    FirstDateTime:= FirstDateTime
else IF time(FirstDateTime) > BusinessEndTime then 
    FirstDateTime:= datetime(date(FirstDateTime)+1, BusinessStartTime)
else IF time(FirstDateTime) < BusinessStartTime then 
    FirstDateTime:= datetime(date(FirstDateTime), BusinessStartTime);
 
IF time(LastDateTime) IN BusinessStartTime TO BusinessEndTime then 
    LastDateTime:= LastDateTime
else IF time(LastDateTime) > BusinessEndTime then 
    LastDateTime:= datetime(date(LastDateTime), BusinessEndTime)
else IF time(LastDateTime) < BusinessStartTime then 
    LastDateTime:= datetime(date(LastDateTime)-1, BusinessEndTime);
 
IF DayOfWeek(FirstDateTime) = 7 Then 
    StartDate := date(FirstDateTime) + 2
Else IF DayOfWeek(FirstDateTime) = 1 Then 
    StartDate := date(FirstDateTime) + 1
Else StartDate:=date(FirstDateTime);
 
IF DayOfWeek(LastDateTime) = 7 Then 
    EndDate := date(LastDateTime) + 2
Else IF DayOfWeek(LastDateTime) = 1 Then 
    EndDate := date(LastDateTime) + 1
Else EndDate := date(LastDateTime);
 
Days:= (EndDate - StartDate)+1;
 
IF Days >= 7 then 
    WeekEnds := (Round((Days/7),0))*2
else IF DayOfWeek(StartDate) > DayOfWeek(EndDate) then 
    WeekEnds := 2
else WeekEnds := 0;
 
IF dayofweek(NewYearsDay2007) <> 7 AND dayofweek(NewYearsDay2007) <> 1 then
(
    IF NewYearsDay2007 IN StartDate TO EndDate then 
        Holidays:=Holidays + 1;
);
 
IF dayofweek(Armistice2007) <> 7 AND dayofweek(Armistice2007) <> 1 then
(
    IF Armistice2007 IN StartDate TO EndDate then 
        Holidays:=Holidays + 1;
);
 
IF dayofweek(fetenat2008) <> 7 AND dayofweek(fetenat2008) <> 1 then
(
    IF fetenat2008 IN StartDate TO EndDate then 
        Holidays:=Holidays + 1;
);
 
IF dayofweek(LundiPaques2007) <> 7 AND dayofweek(LundiPaques2007) <> 1 then
(
    IF LundiPaques2007 IN StartDate TO EndDate then 
        Holidays:=Holidays + 1;
);
 
IF dayofweek(Noel2007) <> 7 AND dayofweek(Noel2007) <> 1 then
(
    IF Noel2007 IN StartDate TO EndDate then 
        Holidays:=Holidays + 1;
);
 
IF dayofweek(Assomption2008) <> 7 AND dayofweek(Assomption2008) <> 1 then
(
    IF Assomption2008 IN StartDate TO EndDate then 
        Holidays:=Holidays + 1;
);
 
IF dayofweek(fetedutravail2007) <> 7 AND dayofweek(fetedutravail2007) <> 1 then
(
    IF fetedutravail2007 IN StartDate TO EndDate then 
        Holidays:=Holidays + 1;
);
 
IF dayofweek(NewYearsDay2008) <> 7 AND dayofweek(NewYearsDay2008) <> 1 then
(
    IF NewYearsDay2008 IN StartDate TO EndDate then 
        Holidays:=Holidays + 1;
);
 
IF dayofweek(Armistice2008) <> 7 AND dayofweek(Armistice2008) <> 1 then
(
    IF Armistice2008 IN StartDate TO EndDate then 
        Holidays:=Holidays + 1;
);
 
IF dayofweek(victoire2007) <> 7 AND dayofweek(victoire2007) <> 1 then
(
    IF victoire2007 IN StartDate TO EndDate then 
        Holidays:=Holidays + 1;
);
 
IF dayofweek(LundiPaques2008) <> 7 AND dayofweek(LundiPaques2008) <> 1 then
(
    IF LundiPaques2008 IN StartDate TO EndDate then 
        Holidays:=Holidays + 1;
);
 
IF dayofweek(Noel2008) <> 7 AND dayofweek(Noel2008) <> 1 then
(
    IF Noel2008 IN StartDate TO EndDate then 
        Holidays:=Holidays + 1;
);
 
IF dayofweek(Ascension2007) <> 7 AND dayofweek(Ascension2007) <> 1 then
(
    IF Ascension2007 IN StartDate TO EndDate then 
        Holidays:=Holidays + 1;
);
 
IF dayofweek(fetedutravail2008) <> 7 AND dayofweek(fetedutravail2008) <> 1 then
(
    IF fetedutravail2008 IN StartDate TO EndDate then 
        Holidays:=Holidays + 1;
);
 
IF dayofweek(NewYearsDay2009) <> 7 AND dayofweek(NewYearsDay2009) <> 1 then
(
    IF NewYearsDay2009 IN StartDate TO EndDate then 
        Holidays:=Holidays + 1;
);
 
IF dayofweek(fetenat2007) <> 7 AND dayofweek(fetenat2007) <> 1 then
(
    IF fetenat2007 IN StartDate TO EndDate then 
        Holidays:=Holidays + 1;
);
 
IF dayofweek(victoire2008) <> 7 AND dayofweek(victoire2008) <> 1 then
(
    IF victoire2008 IN StartDate TO EndDate then 
        Holidays:=Holidays + 1;
);
 
IF dayofweek(LundiPaques2009) <> 7 AND dayofweek(LundiPaques2009) <> 1 then
(
    IF LundiPaques2009 IN StartDate TO EndDate then 
        Holidays:=Holidays + 1;
);
 
IF dayofweek(Assomption2007) <> 7 AND dayofweek(Assomption2007) <> 1 then
(
    IF Assomption2007 IN StartDate TO EndDate then 
        Holidays:=Holidays + 1;
);
 
IF dayofweek(fetedutravail2009) <> 7 AND dayofweek(fetedutravail2009) <> 1 then
(
    IF fetedutravail2009 IN StartDate TO EndDate then 
        Holidays:=Holidays + 1;
);
 
IF dayofweek(Toussaint2007) <> 7 AND dayofweek(Toussaint2007) <> 1 then
(
    IF Toussaint2007 IN StartDate TO EndDate then 
        Holidays:=Holidays + 1;
);
 
IF dayofweek(Toussaint2008) <> 7 AND dayofweek(Toussaint2008) <> 1 then
(
    IF Toussaint2008 IN StartDate TO EndDate then 
        Holidays:=Holidays + 1;
);
 
IF dayofweek(victoire2009) <> 7 AND dayofweek(victoire2009) <> 1 then
(
    IF victoire2009 IN StartDate TO EndDate then 
        Holidays:=Holidays + 1;
);
 
IF dayofweek(Ascension2009) <> 7 AND dayofweek(Ascension2009) <> 1 then
(
    IF Ascension2009 IN StartDate TO EndDate then 
        Holidays:=Holidays + 1;
);
 
IF dayofweek(fetenat2009) <> 7 AND dayofweek(fetenat2009) <> 1 then
(
    IF fetenat2009 IN StartDate TO EndDate then 
        Holidays:=Holidays + 1;
);
 
IF dayofweek(Assomption2009) <> 7 AND dayofweek(Assomption2009) <> 1 then
(
    IF Assomption2009 IN StartDate TO EndDate then 
        Holidays:=Holidays + 1;
);
 
IF dayofweek(Toussaint2009) <> 7 AND dayofweek(Toussaint2009) <> 1 then
(
    IF Toussaint2009 IN StartDate TO EndDate then 
        Holidays:=Holidays + 1;
);
 
IF dayofweek(Armistice2009) <> 7 AND dayofweek(Armistice2009) <> 1 then
(
    IF Armistice2009 IN StartDate TO EndDate then 
        Holidays:=Holidays + 1;
);
 
IF dayofweek(Noel2009) <> 7 AND dayofweek(Noel2009) <> 1 then
(
    IF Noel2009 IN StartDate TO EndDate then 
        Holidays:=Holidays + 1;
);
 
IF dayofweek(NewYearsDay2010) <> 7 AND dayofweek(NewYearsDay2010) <> 1 then
(
    IF NewYearsDay2010 IN StartDate TO EndDate then 
        Holidays:=Holidays + 1;
);
 
IF dayofweek(LundiPaques2010) <> 7 AND dayofweek(LundiPaques2010) <> 1 then
(
    IF LundiPaques2010 IN StartDate TO EndDate then 
        Holidays:=Holidays + 1;
);
 
IF dayofweek(fetedutravail2010) <> 7 AND dayofweek(fetedutravail2010) <> 1 then
(
    IF fetedutravail2010 IN StartDate TO EndDate then 
        Holidays:=Holidays + 1;
);
 
IF dayofweek(victoire2010) <> 7 AND dayofweek(victoire2010) <> 1 then
(
    IF victoire2010 IN StartDate TO EndDate then 
        Holidays:=Holidays + 1;
);
 
IF dayofweek(Ascension2010) <> 7 AND dayofweek(Ascension2010) <> 1 then
(
    IF Ascension2010 IN StartDate TO EndDate then 
        Holidays:=Holidays + 1;
);
 
IF dayofweek(fetenat2010) <> 7 AND dayofweek(fetenat2010) <> 1 then
(
    IF fetenat2010 IN StartDate TO EndDate then 
        Holidays:=Holidays + 1;
);
 
IF dayofweek(Assomption2010) <> 7 AND dayofweek(Assomption2010) <> 1 then
(
    IF Assomption2010 IN StartDate TO EndDate then 
        Holidays:=Holidays + 1;
);
 
IF dayofweek(Toussaint2010) <> 7 AND dayofweek(Toussaint2010) <> 1 then
(
    IF Toussaint2010 IN StartDate TO EndDate then 
        Holidays:=Holidays + 1;
);
 
IF dayofweek(Armistice2010) <> 7 AND dayofweek(Armistice2010) <> 1 then
(
    IF Armistice2010 IN StartDate TO EndDate then 
        Holidays:=Holidays + 1;
);
 
IF dayofweek(Noel2010) <> 7 AND dayofweek(Noel2010) <> 1 then
(
    IF Noel2010 IN StartDate TO EndDate then 
        Holidays:=Holidays + 1;
);
 
IF dayofweek(NewYearsDay2011) <> 7 AND dayofweek(NewYearsDay2011) <> 1 then
(
    IF NewYearsDay2011 IN StartDate TO EndDate then 
        Holidays:=Holidays + 1;
);
 
IF dayofweek(LundiPaques2011) <> 7 AND dayofweek(LundiPaques2011) <> 1 then
(
    IF LundiPaques2011 IN StartDate TO EndDate then 
        Holidays:=Holidays + 1;
);
 
IF dayofweek(fetedutravail2011) <> 7 AND dayofweek(fetedutravail2011) <> 1 then
(
    IF fetedutravail2011 IN StartDate TO EndDate then 
        Holidays:=Holidays + 1;
);
 
IF dayofweek(victoire2011) <> 7 AND dayofweek(victoire2011) <> 1 then
(
    IF victoire2011 IN StartDate TO EndDate then 
        Holidays:=Holidays + 1;
);
 
IF dayofweek(Ascension2011) <> 7 AND dayofweek(Ascension2011) <> 1 then
(
    IF Ascension2011 IN StartDate TO EndDate then 
        Holidays:=Holidays + 1;
);
 
IF dayofweek(fetenat2011) <> 7 AND dayofweek(fetenat2011) <> 1 then
(
    IF fetenat2011 IN StartDate TO EndDate then 
        Holidays:=Holidays + 1;
);
 
IF dayofweek(Assomption2011) <> 7 AND dayofweek(Assomption2011) <> 1 then
(
    IF Assomption2011 IN StartDate TO EndDate then 
        Holidays:=Holidays + 1;
);
 
IF dayofweek(Toussaint2011) <> 7 AND dayofweek(Toussaint2011) <> 1 then
(
    IF Toussaint2011 IN StartDate TO EndDate then 
        Holidays:=Holidays + 1;
);
 
IF dayofweek(Armistice2011) <> 7 AND dayofweek(Armistice2011) <> 1 then
(
    IF Armistice2011 IN StartDate TO EndDate then 
        Holidays:=Holidays + 1;
);
 
IF dayofweek(Noel2011) <> 7 AND dayofweek(Noel2011) <> 1 then
(
    IF Noel2011 IN StartDate TO EndDate then 
        Holidays:=Holidays + 1;
);
 
IF dayofweek(NewYearsDay2012) <> 7 AND dayofweek(NewYearsDay2012) <> 1 then
(
    IF NewYearsDay2012 IN StartDate TO EndDate then 
        Holidays:=Holidays + 1;
);
 
IF dayofweek(LundiPaques2012) <> 7 AND dayofweek(LundiPaques2012) <> 1 then
(
    IF LundiPaques2012 IN StartDate TO EndDate then 
        Holidays:=Holidays + 1;
);
 
IF dayofweek(fetedutravail2012) <> 7 AND dayofweek(fetedutravail2012) <> 1 then
(
    IF fetedutravail2012 IN StartDate TO EndDate then 
        Holidays:=Holidays + 1;
);
 
IF dayofweek(victoire2012) <> 7 AND dayofweek(victoire2012) <> 1 then
(
    IF victoire2012 IN StartDate TO EndDate then 
        Holidays:=Holidays + 1;
);
 
IF dayofweek(Ascension2012) <> 7 AND dayofweek(Ascension2012) <> 1 then
(
    IF Ascension2012 IN StartDate TO EndDate then 
        Holidays:=Holidays + 1;
);
 
IF dayofweek(fetenat2012) <> 7 AND dayofweek(fetenat2012) <> 1 then
(
    IF fetenat2012 IN StartDate TO EndDate then 
        Holidays:=Holidays + 1;
);
 
IF dayofweek(Assomption2012) <> 7 AND dayofweek(Assomption2012) <> 1 then
(
    IF Assomption2012 IN StartDate TO EndDate then 
        Holidays:=Holidays + 1;
);
 
IF dayofweek(Toussaint2012) <> 7 AND dayofweek(Toussaint2012) <> 1 then
(
    IF Toussaint2012 IN StartDate TO EndDate then 
        Holidays:=Holidays + 1;
);
 
IF dayofweek(Armistice2012) <> 7 AND dayofweek(Armistice2012) <> 1 then
(
    IF Armistice2012 IN StartDate TO EndDate then 
        Holidays:=Holidays + 1;
);
 
IF dayofweek(Noel2012) <> 7 AND dayofweek(Noel2012) <> 1 then
(
    IF Noel2012 IN StartDate TO EndDate then 
        Holidays:=Holidays + 1;
);
 
IF dayofweek(NewYearsDay2013) <> 7 AND dayofweek(NewYearsDay2013) <> 1 then
(
    IF NewYearsDay2013 IN StartDate TO EndDate then 
        Holidays:=Holidays + 1;
);
 
IF dayofweek(LundiPaques2013) <> 7 AND dayofweek(LundiPaques2013) <> 1 then
(
    IF LundiPaques2013 IN StartDate TO EndDate then 
        Holidays:=Holidays + 1;
);
 
IF dayofweek(fetedutravail2013) <> 7 AND dayofweek(fetedutravail2013) <> 1 then
(
    IF fetedutravail2013 IN StartDate TO EndDate then 
        Holidays:=Holidays + 1;
);
 
IF dayofweek(victoire2013) <> 7 AND dayofweek(victoire2013) <> 1 then
(
    IF victoire2013 IN StartDate TO EndDate then 
        Holidays:=Holidays + 1;
);
 
IF dayofweek(Ascension2013) <> 7 AND dayofweek(Ascension2013) <> 1 then
(
    IF Ascension2013 IN StartDate TO EndDate then 
        Holidays:=Holidays + 1;
);
 
IF dayofweek(fetenat2013) <> 7 AND dayofweek(fetenat2013) <> 1 then
(
    IF fetenat2013 IN StartDate TO EndDate then 
        Holidays:=Holidays + 1;
);
 
IF dayofweek(Assomption2013) <> 7 AND dayofweek(Assomption2013) <> 1 then
(
    IF Assomption2013 IN StartDate TO EndDate then 
        Holidays:=Holidays + 1;
);
 
IF dayofweek(Toussaint2013) <> 7 AND dayofweek(Toussaint2013) <> 1 then
(
    IF Toussaint2013 IN StartDate TO EndDate then 
        Holidays:=Holidays + 1;
);
 
IF dayofweek(Armistice2013) <> 7 AND dayofweek(Armistice2013) <> 1 then
(
    IF Armistice2013 IN StartDate TO EndDate then 
        Holidays:=Holidays + 1;
);
 
IF dayofweek(Noel2013) <> 7 AND dayofweek(Noel2013) <> 1 then
(
    IF Noel2013 IN StartDate TO EndDate then 
        Holidays:=Holidays + 1;
);
 
IF dayofweek(NewYearsDay2014) <> 7 AND dayofweek(NewYearsDay2014) <> 1 then
(
    IF NewYearsDay2014 IN StartDate TO EndDate then 
        Holidays:=Holidays + 1;
);
 
IF dayofweek(LundiPaques2014) <> 7 AND dayofweek(LundiPaques2014) <> 1 then
(
    IF LundiPaques2014 IN StartDate TO EndDate then 
        Holidays:=Holidays + 1;
);
 
IF dayofweek(fetedutravail2014) <> 7 AND dayofweek(fetedutravail2014) <> 1 then
(
    IF fetedutravail2014 IN StartDate TO EndDate then 
        Holidays:=Holidays + 1;
);
 
IF dayofweek(victoire2014) <> 7 AND dayofweek(victoire2014) <> 1 then
(
    IF victoire2014 IN StartDate TO EndDate then 
        Holidays:=Holidays + 1;
);
 
IF dayofweek(Ascension2014) <> 7 AND dayofweek(Ascension2014) <> 1 then
(
    IF Ascension2014 IN StartDate TO EndDate then 
        Holidays:=Holidays + 1;
);
 
IF dayofweek(fetenat2014) <> 7 AND dayofweek(fetenat2014) <> 1 then
(
    IF fetenat2014 IN StartDate TO EndDate then 
        Holidays:=Holidays + 1;
);
 
IF dayofweek(Assomption2014) <> 7 AND dayofweek(Assomption2014) <> 1 then
(
    IF Assomption2014 IN StartDate TO EndDate then 
        Holidays:=Holidays + 1;
);
 
IF dayofweek(Toussaint2014) <> 7 AND dayofweek(Toussaint2014) <> 1 then
(
    IF Toussaint2014 IN StartDate TO EndDate then 
        Holidays:=Holidays + 1;
);
 
IF dayofweek(Armistice2014) <> 7 AND dayofweek(Armistice2014) <> 1 then
(
    IF Armistice2014 IN StartDate TO EndDate then 
        Holidays:=Holidays + 1;
);
 
IF dayofweek(Noel2014) <> 7 AND dayofweek(Noel2014) <> 1 then
(
    IF Noel2014 IN StartDate TO EndDate then 
        Holidays:=Holidays + 1;
);
 
IF DayOfWeek(LastDateTime) = 7 then 
FinalDays:= FinalDays - 1;
IF DayOfWeek(LastDateTime) = 1 then 
FinalDays:= FinalDays - 2;
 
FinalDays:= Days - Holidays - WeekEnds;
 
IF DayOfWeek(FirstDateTime) = 7 Then 
    FirstDateTime := datetime(date(FirstDateTime) + 2, BusinessStartTime)
Else IF DayOfWeek(FirstDateTime) = 1 Then 
    FirstDateTime := datetime(date(FirstDateTime) + 1, BusinessStartTime);
 
IF DayOfWeek(LastDateTime) = 7 Then 
    LastDateTime := datetime(date(LastDateTime) + 2,BusinessStartTime)
Else IF DayOfWeek(LastDateTime) = 1 Then 
    LastDateTime := datetime(date(LastDateTime) + 1, BusinessStartTime);
 
IF FinalDays <= 1 then
(
    IF date(FirstDateTime) = date(LastDateTime) then
    (
        IF time(FirstDateTime) >= BusinessStartTime then 
            TrueStartTime:= time(FirstDateTime)
        else TrueStartTime:= BusinessStartTime;
 
        IF time(LastDateTime) <= BusinessEndTime then 
            TrueEndTime:= time(LastDateTime)
        else TrueEndTime:= BusinessEndTime
    )
    else TrueStarttime:= BusinessStartTime;
 
    IF time(LastDateTime) <= BusinessEndTime then TrueEndTime:= time(LastDateTime)
    else TrueEndTime:= BusinessEndTime;
 
    hours:= (TrueEndTime-TrueStartTime)/3600;
)
 
Else 
(
halfdays:= ((BusinessEndTime - time(FirstDateTime)) /3600 + (time(LastDateTime) - BusinessStartTime)
/3600);
fulldays:= (FinalDays-2) * HoursInADay; 
hours:= halfdays + fulldays;
);
);
 
hours;
Cordialement
battl14
battl14 est déconnecté   Envoyer un message privé Réponse avec citation 00
Réponse Proposer ce sujet en actualité Cette discussion est résolue.
Outils de la discussion



Fuseau horaire GMT +2. Il est actuellement 17h16.


 
 
 
 
Partenaires

Hébergement Web