Bosna i Hercegovina



#1 17.02.2013-19:20
Bosanec Offline
Clan
Registrovan/a od: 02.02.2009-21:12
Komentari: 128


Subject: problem sa datumom u vba
Pozdrav

imam problem sa ovim uslovom u vba

uslov = "SELECT * FROM tblPK WHERE (tblPK.periodD)= " & "#" & Format(Me.[Datum], "dd/mm/yy") & "#"

javlja mi grešku syntax eror in date in query

u čemu je problem
↑  ↓

#2 17.02.2013-19:24
Amelasar Offline
Clan
Registrovan/a od: 07.04.2011-18:28
Komentari: 234


Subject: Re: problem sa datumom u vba
Probaj ovako:

uslov = "SELECT * FROM tblPK WHERE (tblPK.periodD)= " & "#" & Format(Me.[Datum], "dd-mm-yyyy") & "#"
Pozdrav, Amela
↑  ↓

#3 17.02.2013-19:38
Bosanec Offline
Clan
Registrovan/a od: 02.02.2009-21:12
Komentari: 128


Subject: Re: problem sa datumom u vba
neće ni tako greška no curent record
↑  ↓

#4 17.02.2013-19:47
zxz Offline
Administrator
Registrovan/a od: 03.02.2009-16:22
Komentari: 9,721


Subject: Re: problem sa datumom u vba
Dim DatumS as string

DatumS="#" & Format(Me.datum,"mm-dd-yyyy") & "#"

Uslov="SELECT * FROM tblPK WHERE periodD=" & Datums
Pozdrav
Ovaj komentar je mijenjan 1 puta. zadnja izmjena 17.02.2013-19:47 od strane zxz. ↑  ↓

#5 17.02.2013-20:24
Bosanec Offline
Clan
Registrovan/a od: 02.02.2009-21:12
Komentari: 128


Subject: Re: problem sa datumom u vba
Dim DatumS as string

DatumS="#" & Format(Me.datum,"mm-dd-yyyy") & "#"

Uslov="SELECT * FROM tblPK WHERE periodD=" & Datums

ovako hoće

hvala zxz

a hoće i ovako pomoću ove funkcije

Function SQLDate(varDate As Variant) As String
'Purpose: Return a delimited string in the date format used natively by JET SQL.
'Argument: A date/time value.
'Note: Returns just the date format if the argument has no time component,
' or a date/time format if it does.
'Author: Allen Browne. allen@allenbrowne.com, June 2006.
If IsDate(varDate) Then
If DateValue(varDate) = varDate Then
SQLDate = Format$(varDate, "\#mm\/dd\/yyyy\#")
Else
SQLDate = Format$(varDate, "\#mm\/dd\/yyyy hh\:nn\:ss\#")
End If
End If
End Function

e jesam se pošteno namučio Smiling

pozdrav
↑  ↓

#6 17.02.2013-20:39
zxz Offline
Administrator
Registrovan/a od: 03.02.2009-16:22
Komentari: 9,721


Subject: Re: problem sa datumom u vba
Ima negdje napisano o ovome na forumu.
SDQL prihvata samo americki datum i samo je to bila greska.
Znaci datum mora biti:
mjesec-dan-godina
Pozdrav
↑  ↓

Stranice (1): 1


All times are GMT +01:00. Current time: 20.07.2018-19:11.