Avatar billede bentbent Nybegynder
29. oktober 2003 - 02:33 Der er 7 kommentarer og
1 løsning

omdøbe tabel samt forespørgsler!

Hejsa!

Jeg har så dum jeg er en database med en tabel ved navn "count" til denne tabel peger 15 forespørgsler!

Problemet er dog at ordet "count" er forbeholdt sql og tabellen skal derfor omdøbes før min asp løsning kan fungere!

Er der en smart måde man kan omdøbe tabellen, således alle relationer til forespørgslerne samtidig bliver opdateret???
Avatar billede mugs Novice
29. oktober 2003 - 05:57 #1
Avatar billede hugopedersen Nybegynder
29. oktober 2003 - 10:16 #2
Avatar billede terry Ekspert
29. oktober 2003 - 12:06 #3
You dont need to!

SELECT * from [count].....
Avatar billede terry Ekspert
29. oktober 2003 - 12:07 #4
but it is obviously best to NOT use reserved names!
Avatar billede terry Ekspert
29. oktober 2003 - 12:08 #5
bentbent you still have an open question here http://www.eksperten.dk/spm/417204
Avatar billede bentbent Nybegynder
29. oktober 2003 - 14:17 #6
Tak for de gode bud, jeg prøvede SpeedFerret som virkede rigtig godt, men den kunne desværre ikke finde ud af at erstatte "count"!

Da jeg snart har prøvet i over 3 timer at få det til at du, ville jeg høre om nogle af jer kunne omskrive nedenstående:

tabellen "count" hedder ny "countlog"

På forhånd tak!

1...........................

SELECT count.IP, count.Referent, count.Browser, count.Sprog, count.Host, count.Tid, count.Dato, First(DateDiff("d",[dato],Date())) AS nrdays, Format$(count.Dato,'ww yyyy') AS Week, Format$(count.Dato,'yyyy') AS [Year], Format$(count.Dato,'mmmm yyyy') AS [Month], Format$(count.Dato,'Long Date') AS Days, Format$(count.Dato,'"Kvt"q yyyy') AS kvar
FROM [count]
GROUP BY count.IP, count.Referent, count.Browser, count.Sprog, count.Host, count.Tid, count.Dato, Format$(count.Dato,'ww yyyy'), Format$(count.Dato,'yyyy'), Format$(count.Dato,'mmmm yyyy'), Format$(count.Dato,'Long Date'), Format$(count.Dato,'"Kvt"q yyyy');

2............................
SELECT DISTINCTROW count.Browser, Count(*) AS nrofcount, [Nrofcount]/((Select count(*) from [count])/100) AS pct
FROM [count]
GROUP BY count.Browser;

3............................
SELECT DISTINCTROW Format$(count.Dato,'Long Date') AS Days, Count(*) AS nrofcount, [Nrofcount]/((Select count(*) from [count])/100) AS pct, First(DateDiff("d",[dato],Date())) AS nrdays
FROM [count]
GROUP BY Format$(count.Dato,'Long Date');
Avatar billede terry Ekspert
29. oktober 2003 - 18:17 #7
well taht wasnt the original question bentbent but none the less

SELECT countlog.IP, countlog.Referent, countlog.Browser, countlog.Sprog, countlog.Host, countlog.Tid, countlog.Dato, First(DateDiff("d",[dato],Date())) AS nrdays, Format$(countlog.Dato,'ww yyyy') AS Week, Format$(countlog.Dato,'yyyy') AS [Year], Format$(countlog.Dato,'mmmm yyyy') AS [Month], Format$(countlog.Dato,'Long Date') AS Days, Format$(countlog.Dato,'"Kvt"q yyyy') AS kvar
FROM [countlog]
GROUP BY countlog.IP, countlog.Referent, countlog.Browser, countlog.Sprog, countlog.Host, countlog.Tid, countlog.Dato, Format$(countlog.Dato,'ww yyyy'), Format$(countlog.Dato,'yyyy'), Format$(countlog.Dato,'mmmm yyyy'), Format$(countlog.Dato,'Long Date'), Format$(countlog.Dato,'"Kvt"q yyyy');

2............................
SELECT DISTINCTROW countlog.Browser, Count(*) AS nrofcount, [Nrofcount]/((Select count(*) from [countlog])/100) AS pct
FROM [countlog]
GROUP BY countlog.Browser;

3............................
SELECT DISTINCTROW Format$(countlog.Dato,'Long Date') AS Days, Count(*) AS nrofcount, [Nrofcount]/((Select count(*) from [countlog])/100) AS pct, First(DateDiff("d",[dato],Date())) AS nrdays
FROM [countlog]
GROUP BY Format$(countlog.Dato,'Long Date');
Avatar billede terry Ekspert
29. oktober 2003 - 18:17 #8
what would we do without notepad :o)
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
Dyk ned i databasernes verden på et af vores praksisnære Access-kurser

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