Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
I have attached an excel sheet. There i need to split same table into two.
I want to assign a field name as 'Phase1' From DateCoded (12-Nov - 15-Nov)
and 'Phase2' from DateCoded (16-Nov - 17-Nov)
So in my application i should able to select a field called Phase, there i should able to selecet Phase1 and Phase2
Thanks in advance.
Hi, Ranjit
you must not split your table, better you enter a new field like this:
If(DateCoded>Firstdate And DateCoded<Lastdate,'Phase 1','Phase2') As Phase
Firstdate can be a variable or a Datefield or an expression
Hey Ranjit, I don't understand why you want to split that table.
If I were you I would do something like this (just the idea) :
Table1:
load * from bool1.xlsx;
ResidentTable1:
load
DateCoded,
DateCoded as Phase,
if(DateCoded 12 - 15 nov, DateCoded) as Phase1,
if(DateCoded 16- 17 nov, DateCoded) as Phase2
resident Table1;
Hope it helps!!
HI Martina thanks for your reply,
It worked fine,
I framed it like below
If([Date Coded]>= 40494 And [Date Coded]< 40501,'Phase 1','Phase 2') As Phase,
Is there a way where in instead putting 40494, can i put 12-nov or 11/12/2010. When i tried 11/12/2010 it dint work, because the system needs to understand the format.
Please suggest. But your answer worked perfect.
Ranjit wrote:Is there a way where in instead putting 40494, can i put 12-nov or 11/12/2010. When i tried 11/12/2010 it dint work, because the system needs to understand the format.
Here are a couple ways:
makedate(2010,11,12)
date#('11/12/2010','MM/DD/YYYY')