Avatar billede guzzie Nybegynder
12. juni 2001 - 13:54 Der er 20 kommentarer og
2 løsninger

select by dato

I use the following connection
strSQL = \"SELECT * FROM photobase WHERE type = \'\" & type_pic & \"\' AND kategori = \'\" & kat & \"\' AND dato >= \" & Mydato & \" AND\"
strSQL = strSQL & \" (beskrivelse LIKE \'%\" & search & \"%\') ORDER BY dato DESC \"

when I response.write the strSQL it looks correct
also the date is fine. However instead of selecting by date it take all dates even those which are older than requested :(
Any ideas ?
Guzzie
Avatar billede tpiil Nybegynder
12. juni 2001 - 14:53 #1
prøv med nogle # foran og bagved dato\'en...
Avatar billede guzzie Nybegynder
12. juni 2001 - 15:04 #2
hey tpiil :)
I tried that before also and heres the response.write from it
SELECT * FROM photobase WHERE type = \'Duo tone\' AND kategori = \'Natur\' AND dato >= #07-06-2001# AND (beskrivelse LIKE \'%a%\') ORDER BY dato DESC

however none of the results are then shown

I have a whole bunch of results that should get shown from the 09-06-2001 but the dont

however if i change the date to the 06-06-2001
then i get all my results back ?? I had this problem before that why I was trying a something diffrent

Guzzie :]
Avatar billede tpiil Nybegynder
12. juni 2001 - 15:08 #3
sikker på at din > vender rigtigt??
Avatar billede guzzie Nybegynder
12. juni 2001 - 15:15 #4
hmmm if I changed it around then I would only recieve results the would be less than <  the date searched for ?? woulnt I or ...??
hmmm...
me do a quick test :)
Guzzie
Avatar billede guzzie Nybegynder
12. juni 2001 - 15:18 #5
nope that didnt work :(
Im off home now so will be back online in 2 hours
Guzzie
Avatar billede jakobandersen Nybegynder
12. juni 2001 - 16:16 #6
I have two two pretty silly questions:

1) What fieldtype is dato?
2) What DBMS(or worst case Access) are you using?

Jakob
Avatar billede guzzie Nybegynder
12. juni 2001 - 23:43 #7
moonduck//
1 = dato is a date colume and not text or notat
2 = access
Guzzie
Avatar billede jakobandersen Nybegynder
13. juni 2001 - 00:00 #8
Try something like this:

strSQL = \"SELECT * FROM photobase WHERE type = \'\" & type_pic & \"\' AND kategori = \'\" & kat & \"\' AND CDate(dato) >= #\" & Mydato & \"# AND Beskrivelse LIKE \'%\" & Search & \"%\' ORDER BY dato DESC
Avatar billede guzzie Nybegynder
13. juni 2001 - 00:30 #9
k will try tomorrow im off to bed
guzzie <--- must go to work soon :(
sniff
nat nat
Avatar billede guzzie Nybegynder
13. juni 2001 - 09:08 #10
Morning :)
moonduck// nope sorry that didnt work I still have the same problem
tpiil// if I choose the date as the 6 of june then it can find all my post ??

So now i am wondering if the \"day\" that it is finding is not the 9 day of the month but the 9th month - An I think this is way that whenever I choose the date as the 6 og june then it can find all my results, the 6th also being the 6th month ??
Any ideas :( sniff
Guzzie
Avatar billede jakobandersen Nybegynder
13. juni 2001 - 11:31 #11
FormatDateTime() function.. Read more at:
http://msdn.microsoft.com/scripting/vbscript/doc/vsfctFormatDateTime.htm

Or else set the Language in the database to te same as the one on the webserver.
Avatar billede guzzie Nybegynder
13. juni 2001 - 14:51 #12
Moonduck// I tried using the GetCurrentDate funchion the Microsoft has but still am getting the same results :(
You said before that I should try setting the language in the database to the one one my server ?
How is that done ?? or is it some simple script that I should insert into my asp page ??
Thanks
Guzzie
Avatar billede guzzie Nybegynder
14. juni 2001 - 22:36 #13
hmmm
nobody home ??
think I am gonna close this question soon :(
Avatar billede guzzie Nybegynder
14. juni 2001 - 22:37 #14
?
Avatar billede jakobandersen Nybegynder
14. juni 2001 - 22:40 #15
Try use the Session.LCID = \"countrycode\" and use the same language settings as the DB.
Avatar billede guzzie Nybegynder
15. juni 2001 - 09:41 #16
hmmm sorry moonduck I dont understand
how do I use the same language settings as the DB
what i mean is where is do I set the language settings ?
I assume you mean I insert
<% Session.LCID = \"countrycode\" %>
into my asp page but the language setup I dont get ?
Guzzie
Avatar billede jakobandersen Nybegynder
15. juni 2001 - 14:33 #17
Look in the documentation for Session.LCID on the microsoft website.
Avatar billede guzzie Nybegynder
10. juli 2001 - 13:18 #18
//moonduck  thanks for the help
I want to give you the points but you name dosn\'t appear in the \"Accepter\" field ?
Should I just make a new question and you can get your points there ?
Guzzie
Avatar billede jakobandersen Nybegynder
10. juli 2001 - 13:23 #19
It would be nice :-)
Avatar billede guzzie Nybegynder
10. juli 2001 - 13:33 #20
I will close this then and make a new question :)
Avatar billede okay Nybegynder
10. juli 2001 - 13:40 #21
hvorfor skriver Tpiil til ham på dansk, og han svarer på engelsk ???
Avatar billede guzzie Nybegynder
10. juli 2001 - 13:44 #22
I am English :p I live in Denmark and read danish but my written Danish is not a so Fantastic *gg
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Kurser inden for grundlæggende programmering

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester