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.
What is it you actually want help on? Do you want help on making a report showing the 16 years columns or do you only want to know how to calculate a field depending on year and interval.IE when they are to be inspected?
Its easy to set (calculate) a field value depending on values of other fields, but as I dont know exactly how much you have done to you report, then I cant say which is the easiest method!
This is an SQL statement which has a calculated field \"Efterses\" which gets set to True (-1) or False (0) depending on whether or not IndbygningsÅr]+[EfterSynsInterval] is = the current year (Year(Now()). Now I dont know your table layout so this is just an example!
SELECT tblEfterSyn.ID, tblEfterSyn.IndbygningsÅr, tblEfterSyn.EfterSynsInterval, tblEfterSyn.Dagddato, IIf(Year(Now())=[IndbygningsÅr]+[EfterSynsInterval],-1,0) AS Efterses FROM tblEfterSyn;
In your last mail (10:16:32) what is X, I know you say it is 1 to 16, but is it the name of a field or a column. Is it the index to some array, In your IIF when you write ([Indbygningsår] which of the 16 years is this, is this your X? As I said in my first comment, I cant see what you have done so its difficult to help you. How have you found the data (16 years) to show on the report, have you used a CrossTab query or what?
The SQL SELECT statement calculates the extra field \"Efterses\" which could then be used in your report without having to make the calculation again.
The reason why its not easy to give you a definate answer is that it all depends on how you have made your report up to now. It sounds as though you are expecting to have 16 columns, but how you get there I have no idea?
Just out of interest, can you see the other information correctly on your report, IE the IndbygningsÅr and Inteval etc?
Yes I see all other info correctly. Gosh it is hard to explain what I am trying to make....
My project is based on an old filemaker-database. I am making a total rewrite. I have a screenshot of the report from the old filemaker-DB here: http://www.folda.dk/report.jpg
My table does not contain the 16 colums, only the report. My table contain only the fields: Indbygningsår Eftersynsinterval current date
I think I can use your SQL, and will return when I get time to try it out. Thanks for your help so far!
So you have 16 columns, one per year,and also a number of rows, one per bygningsdel. I assume that the fields are named something like fldYear1, fldInterval1, fldYear2, fldInterval2.... for the 16 columns. So it would be just a case of putting an extra field (or better still, check box)named fldEfterse in each column and then calculating this on the corresponding year and interval using IIF(...).
Jeg var vist lidt for hurtig, for det ser ud til at mit problem ikke er løst alligevel....
Jeg har defineret en række på 16 tekstbokse som [ÅR1] som =Year(Now()) [ÅR2] som =Year(Now())+1 etc.
Under dem en række afkrydsningfelter der er defineret som =IIf([ÅR1]=[Indbygningsår]+[Eftersynsinterval];\"sand\";\"falsk\") =IIf([ÅR2]=[Indbygningsår]+[Eftersynsinterval];\"sand\";\"falsk\") etc.
Dette virker også fint, bortset fra at vedligeholdsintervallet ikke gentages... Det er således kun de første felter i min oversigt der virker.
Jeg skal have gentaget Iff-sætningen, hvor Eftersynsintervallet ganges op med tal fra 1 til 16.
Havde det været BASIC skulle jeg skal ud i noget lignende det her:
For X = 1 to 16 =IIf([ÅR1]=[Indbygningsår]+[Eftersynsinterval]*X;\"sand\";\"falsk\") Next X
Jeg har også forsøgt mig med at oprette en ny tabel kaldet ÅR. indeholdende feltet ÅR, med tallene fra 1 til 16.
=IIf([ÅR1]=[Indbygningsår]+[Eftersynsinterval]*(SELECT[ÅR].[ÅR] FROM ÅR);\"sand\";\"falsk\")
Foldager> First, thanks very much for the points. As I have said a couple of times now, its hard for me to give yoy the correct answer as I have little knowledge of you database, and we could use far too much time for me sending mails back and forth, so, if you want me to help then I think it would be best if you sent me the dB.
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.