Jump to content

How To Set Up A Sql Report That Uses A Unique Date Code System


ready2drum

Recommended Posts

I have a SQL query that requires a change/edit to the code so that the SQL Report displays the correct date displays (i.e. the correct 'month' and 'year'. ) The way the query is written, there is a 'letter designator' for the 'month' and a 'number' to represent the 'year'. See code below:

(invnt.unit_id LIKE 'TX1%9K%')

In the example, 9K=the '9' represents the year '2009', and the 'K' represents the month of 'October' based on the rotating monthly alpha code:*2009A=JanuaryB=FebruaryC=MarchD=AprilE=MayF=JuneG=JulyH=August(no I)J=SeptemberK=OctoberL=NovemberM=December----The letters run on a one letter per month - 2 yr cycle (excluding the letters, I, and O.)*2010(no O)N=JanuaryP=FebruaryQ=MarchR=AprilS=MayT=JuneU=JulyV=AugustW=SeptemberX=OctoberY=NovemberZ=December---------*2011A=JanuaryB=FebruaryC=MarchD=AprilE=MayF=JuneG=JulyH=August(no I)J=SeptemberK=OctoberL=NovemberM=DecemberThe rotating monthly alpha calendar setup is a permanent fixture and cannot be altered or deleted, so I have to find a way to work with it, but I need some guidance/help with how to work with it. If anyone knows of a way to or can show me how to code this report up so that the user viewing the report can select the month/year from a date calendar without me having to go in the SQL query and manually changing the year and letter designator for the month, I'd greatly appreciate it alot.Thanks in advance!

Link to comment
Share on other sites

I'm not sure what you mean, if the user wants to see different data you're always going to need to change the query. I assume you would have some software interacting with the database which would get their entries and build the query.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...