28. august 2002 - 09:01
Der er
8 kommentarer og 1 løsning
DatePart + 1
jeg bruger de 2 variabler uge og uge1 til at finde hvilket uge nummer vi er i, jeg har også date() kan jeg på en eller ande måde ligge en dag til date sådan at d. 12 bliver til d. 13 ?? uge=DatePart("ww", date(), vbMonday, vbFirstFourDays) uge1=DatePart("ww", date())
Annonceindlæg tema
Cloud & AI
I dette særtema ser vi på, hvordan cloud og AI bliver fundamentet for virksomhedernes digitale forretning, og hvordan de nye muligheder for automatisering og forretningsværdi kan udnyttes uden at miste overblik, sikkerhed og menneskelig kontrol.
28. august 2002 - 09:04
#1
Du kan bruge dateAdd: dato = DateAdd("d", 1, date()) Response.write dato
28. august 2002 - 09:05
#2
date()+1 burde gøre det
28. august 2002 - 09:06
#3
28. august 2002 - 09:14
#4
Sådan her ? dato = DateAdd("d", 1, date()) uge=DatePart("ww", dato, vbMonday, vbFirstFourDays) uge1=DatePart("ww", dato)
28. august 2002 - 09:21
#5
Ja hvis variablen uge og uge1 skal udregnet ud fra samme dato. Hvis uge skal udregnes ud fra idag date() og uge1 skal udregnes ud i morgen skal det være sådan her: 'udregn uge for i dag uge=DatePart("ww", date(), vbMonday, vbFirstFourDays) 'Find datoen for i morgen dato = DateAdd("d", 1, date()) 'udregn uge1 for i morgen uge1=DatePart("ww", dato)
28. august 2002 - 10:50
#6
Arrg jeg kan ikke få det til at virke: hvor er det jeg skal sætte dato = DateAdd("d", 1, date()) ind så ugen skifter om søndagen istedet for mandag ?? <% sti="../pict/" uge=DatePart("ww", date(), vbMonday, vbFirstFourDays) uge1=DatePart("ww", date()) uge2 = request.querystring("uge1") response.write "<center>" for i = 1 to 1 if uge = 1 then nuuge = uge&"-qwe" billed = sti&uge&".gif" end if if uge = 2 then nuuge = uge&"-wer" billed = sti&uge&".gif" end if if uge = 3 then nuuge = uge&"-ert" billed = sti&uge&".gif" end if if uge = 4 then nuuge = uge&"-rty" billed = sti&uge&".gif" end if if uge = 5 then nuuge = uge&"-tyu" billed = sti&uge&".gif" end if if uge = 6 then nuuge = uge&"-yui" billed = sti&uge&".gif" end if if uge = 7 then nuuge = uge&"-uio" billed = sti&uge&".gif" end if if uge = 8 then nuuge = uge&"-iop" billed = sti&uge&".gif" end if if uge = 9 then nuuge = uge&"-opa" billed = sti&uge&".gif" end if if uge = 10 then nuuge = uge&"-asd" billed = sti&uge&".gif" end if if uge = 11 then nuuge = uge&"-sdf" billed = sti&uge&".gif" end if if uge = 12 then nuuge = uge&"-dfg" billed = sti&uge&".gif" end if if uge = 13 then nuuge = uge&"-fgh" billed = sti&uge&".gif" end if if uge = 14 then nuuge = uge&"-ghj" billed = sti&uge&".gif" end if if uge = 15 then nuuge = uge&"-hjk" billed = sti&uge&".gif" end if if uge = 16 then nuuge = uge&"-jkl" billed = sti&uge&".gif" end if if uge = 17 then nuuge = uge&"-klz" billed = sti&uge&".gif" end if if uge = 18 then nuuge = uge&"-xcv" billed = sti&uge&".gif" end if if uge = 19 then nuuge = uge&"-cvb" billed = sti&uge&".gif" end if if uge = 20 then nuuge = uge&"-vbn" billed = sti&uge&".gif" end if if uge = 21 then nuuge = uge&"-bnm" billed = sti&uge&".gif" end if if uge = 22 then nuuge = uge&"-nmn" billed = sti&uge&".gif" end if if uge = 23 then nuuge = uge&"-mnb" billed = sti&uge&".gif" end if if uge = 24 then nuuge = uge&"-qaz" billed = sti&uge&".gif" end if if uge = 25 then nuuge = uge&"-wsx" billed = sti&uge&".gif" end if if uge = 26 then nuuge = uge&"-edc" billed = sti&uge&".gif" end if if uge = 27 then nuuge = uge&"-rfv" billed = sti&uge&".gif" end if if uge = 28 then nuuge = uge&"-tgb" billed = sti&uge&".gif" end if if uge = 29 then nuuge = uge&"-yhn" billed = sti&uge&".gif" end if if uge = 30 then nuuge = uge&"-ujm" billed = sti&uge&".gif" end if if uge = 31 then nuuge = uge&"-zaq" billed = sti&uge&".gif" end if if uge = 32 then nuuge = uge&"-xsw" billed = sti&uge&".gif" end if if uge = 33 then nuuge = uge&"-cde" billed = sti&uge&".gif" end if if uge = 34 then nuuge = uge&"-vfr" billed = sti&uge&".gif" end if if uge = 35 then nuuge = uge&"-bgt" billed = sti&uge&".gif" end if if uge = 36 then nuuge = uge&"-nhy" billed = sti&uge&".gif" end if if uge = 37 then nuuge = uge&"-mju" billed = sti&uge&".gif" end if if uge = 38 then nuuge = uge&"-aqz" billed = sti&uge&".gif" end if if uge = 39 then nuuge = uge&"-swx" billed = sti&uge&".gif" end if if uge = 40 then nuuge = uge&"-dec" billed = sti&uge&".gif" end if if uge = 41 then nuuge = uge&"-frv" billed = sti&uge&".gif" end if if uge = 42 then nuuge = uge&"-gtb" billed = sti&uge&".gif" end if if uge = 43 then nuuge = uge&"-hyn" billed = sti&uge&".gif" end if if uge = 44 then nuuge = uge&"-jum" billed = sti&uge&".gif" end if if uge = 45 then nuuge = uge&"-qet" billed = sti&uge&".gif" end if if uge = 46 then nuuge = uge&"-wry" billed = sti&uge&".gif" end if if uge = 47 then nuuge = uge&"-adg" billed = sti&uge&".gif" end if if uge = 48 then nuuge = uge&"-thm" billed = sti&uge&".gif" end if if uge = 49 then nuuge = uge&"-evu" billed = sti&uge&".gif" end if if uge = 50 then nuuge = uge&"-ihf" billed = sti&uge&".gif" end if if uge = 51 then nuuge = uge&"-lpk" billed = sti&uge&".gif" end if if uge = 52 then nuuge = uge&"-kag" billed = sti&uge&".gif" end if if Cint(uge2) = Cint(uge) then 'response.write " <img src='../pict/img-uger/nu/"&uge & ".gif' border='0'>" else %> <script language="javascript"> parent.bund.location.href="../uger/<%=nuuge%>/index.asp?uge1=<%=uge1%>&xstien=<%=nuuge%>" </script> <meta name="site-config-URL" content=""> <% end if dato = dateadd("ww", i, date()) uge=DatePart("ww", dato, vbMonday, vbFirstFourDays) next %>
28. august 2002 - 10:58
#7
jeg gjorde sådan og det ser ud til at virke uge=DatePart("ww", date()+1, vbMonday, vbFirstFourDays) uge1=DatePart("ww", date()) uge2 = request.querystring("uge1") response.write "<center>" for i = 1 to 1 if uge = 1 then nuuge = uge&"-qwe" billed = sti&uge&".gif" end if
28. august 2002 - 11:13
#8
Jeg må indrømme at jeg forstår ikke din kode...
hvor er det jeg skal sætte dato = DateAdd("d", 1, date()) ind så ugen skifter om søndagen istedet for mandag ??
Man bruger DatePart til at bestemme hvilken uge man er i, og man kan give en parameter som siger hvilken dag som er den føste i en ny uge. Der er en bug i DatePart e hvad MS skriver...:
http://support.microsoft.com/default.aspx?scid=KB;EN-US;q200299&
29. august 2002 - 08:28
#9
Vil det sige at jeg kan få den til at skifte søndag ved at skrive vbSunday ??
Kurser inden for grundlæggende programmering