PeeerMedlem sedan mars 20025 907 inlägg strSQL = "SELECT id, content, datum FROM t_news WHERE typID = 3 AND datum > #" &DateAdd("d", -1, now())&"# AND typ = True ORDER BY datum ASC"
[red]Här skrivs resultatet ut![/red]
strSQL = "SELECT id, content, datum FROM t_news WHERE typID = 3 AND datum > #" &DateAdd("d", -30, now())&"# AND typ = False ORDER BY datum ASC"
[red]Här skrivs det andra resultatet ut[/red]
Finns det något sätt att slå ihop dessa satser så det bara blir en läsning från databasen? (access). Resultaten ska skrivas ut i samma ordning som de gör nu!
LarsGMedlem sedan dec. 200012 464 inlägg Tja, typ
strSQL = "SELECT id, content, datum " &_
" FROM t_news " & _
" WHERE typID = 3 " &_
" AND datum > DateAdd('d', -30, now()) "
" AND ((TYP and datum > DateAdd('d', -1,now()) or not typ )" &_
" ORDER BY typ,datum ASC"
PeeerMedlem sedan mars 20025 907 inlägg Feltyp:
Microsoft JET Database Engine (0x80040E14)
Syntaxfel (operator saknas) i frågeuttrycket 'typID = 3 AND datum > #2002-11-14 19:11:04# AND ((TYP and datum > #2002-12-13 19:11:04# or not typ ) ORDER BY typ,datum ASC'.
/index.asp, line 58
SELECT id, content, datum FROM t_news WHERE typID = 3 AND datum > #2002-11-14 19:12:04# AND ((TYP and datum > #2002-12-13 19:12:04# or not typ ) ORDER BY typ,datum ASC
Tips??
LarsGMedlem sedan dec. 200012 464 inlägg )-parentes saknas (framför or)
SELECT id, content, datum FROM t_news WHERE typID = 3 AND datum > #2002-11-14 19:12:04# AND ((TYP and datum > #2002-12-13 19:12:04# ) or not typ ) ORDER BY typ,datum ASC
PeeerMedlem sedan mars 20025 907 inlägg Funkar jättebra!
Tackar & bockar!!