Dear experts,
to convert date period in rows which function i can use in access like 01-01-13 to 15-01-13 this fifteen days period how can i get in query
in rows.
01-01-13
02-01-13
03-01-13
04-01-13
05-01-13
.....
.....
Dear experts,
to convert date period in rows which function i can use in access like 01-01-13 to 15-01-13 this fifteen days period how can i get in query
in rows.
01-01-13
02-01-13
03-01-13
04-01-13
05-01-13
.....
.....
What are you trying to do in plain English?
Provide a sample if that helps.
i have two columns datefrom and dateto 01-01-13 to 15-01-13 this date period i have in table in columns. in query i want to get result as below
01-01-13
02-01-13
03-01-13
04-01-13 upto 15-01-13 it will be fifteen rows i think now it will be clear. my question was which function i have to use to get this result in access database
please have a look on my request
???I'm looking. What am I suppose to see???
Not clear to me.i think now it will be clear
Show us all the fields in the table and what fields you want in the result.
my fields are below.
ID , DATEFROM, DATETO
23 , 01-01-12 , 15-01-12
result should come as below
23 , 01-01-12
23, 02-01-12
23, 03-01-12
23, 04-01-12
.......upto......
23, 15-01-12
Here is a sample routine to show each Date between DateFrom and DateTo
Code:'--------------------------------------------------------------------------------------- ' Procedure : waqas ' Author : Jack ' Date : 27/02/2013 ' Purpose : To display all Dates between DateFrom until and including DateTo ' 'OP https://www.accessforums.net/queries/how-convert-date-period-single-column-rows-32787.html#post161423 '--------------------------------------------------------------------------------------- ' Sub waqas() Dim DateFrom As Date Dim DateTo As Date Dim DateToShow As Date 10 On Error GoTo waqas_Error ' Date format depends on your settings 20 DateFrom = #1/1/2012# 'sample dateFrom 30 DateTo = #1/15/2012# 'sample DateTo 40 DateToShow = DateSerial(Year(DateFrom), Month(DateFrom), Day(DateFrom)) ' Debug.Print DateToShow 50 While DateToShow <= DateTo 60 Debug.Print DateToShow 70 DateToShow = DateAdd("d", 1, DateToShow) 80 Wend 90 On Error GoTo 0 100 Exit Sub waqas_Error: 110 MsgBox "Error " & Err.number & " (" & Err.Description & ") in procedure waqas of Module AWF_Related" End Sub
thanks fine,
but i want to do by query.
Great! Use the code sample I gave; make it a function, and call it from a query.