1 pièce(s) jointe(s)
transformer une requete sql server en sql access
Bonjour,
A Partir d'une requete sql server ( ci dessous) ,Je dois transformer cette requete sous Access 2010.
En pièce jointe, je vous aie inseré , sous forme de tableau Excel, le resultat de cette requete sql server.
Voici la requete sql server
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
|
DECLARE @StartDateTime DATETIME
DECLARE @EndDateTime DATETIME
SELECT
[Parcel]
,IDT13.[Barcode] as Cab_Suivi
,IDT24.[Barcode] as Cab_Pch
,IDT28.[Barcode] as Cab_Geolabel
,Event_Sortie.[datetime] as Heure_tri
FROM [Parcel] with (nolock)
Inner join [ParcelEvent] as Event_Sortie with (nolock) on [Parcel].[Id] = Event_Sortie.[ParcelId]
Left outer join [Barcode] as IDT13 with(nolock) on IDT13.[ParcelId] = [Parcel].[Id] and len(IDT13.[Barcode])='13'
Left outer join [Barcode] as IDT24 with(nolock) on IDT24.[ParcelId] = [Parcel].[Id] and len(IDT24.[Barcode])='24'
Left outer join [Barcode] as IDT28 with(nolock) on IDT28.[ParcelId] = [Parcel].[Id] and len(IDT28.[Barcode])='28
where Event_Sortie.[Datetime] between @StartDateTime and @EndDateTime and Event_Sortie.EventTypeNum in (2,34) and [Parcel].[PhysicalChuteNum]=449
order by Heure_tri |
Voici la requete En sql Access que j'ai faite
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
| PARAMETERS debut DateTime, fin DateTime;
SELECT
[Parcel].Id
,IDT13.[Barcode] as Cab_Suivi
,IDT24.[Barcode] as Cab_Pch
,IDT28.[Barcode] as Cab_Geolabel
,[Parcel].PostalCode as Code_Postal
,Event_Sortie.[datetime] as Heure_tri
FROM ((( [Parcel]
Inner join [ParcelEvent] as Event_Sortie on [Parcel].[Id] = Event_Sortie.[ParcelId])
Left join [Barcode] as IDT13 on IDT13.[ParcelId] = [Parcel].[Id] )
Left join [Barcode] as IDT24 n IDT24.[ParcelId] = [Parcel].[Id] )
Left join [Barcode] as IDT28 on IDT28.[ParcelId] = [Parcel].[Id]
where (( Event_Sortie.[Datetime] between [debut] and [fin])
and ( Event_Sortie.EventTypeNum in (2,34) )
and (len(IDT13.[Barcode])='13')
And (len(IDT24.[Barcode])='24')
And (len(IDT28.[Barcode])='28'))
order by Heure_tri; |
Mais malheureusement, je n'ai pas de donnée lorsque je lance cette requete sous access avec les mêmes parametre de date debut et fin
Pourriez vous me dire ou j 'ai commis l'erreur dans la transformation de ma requete sous access ?
Merci de votre aide