Hi, I am sort of a script kiddie when it comes to creating views. I would appreciate it if you could help me create the right SQL view for this situation. I have a table of data which includes a date - field name is JRNLDATE
JRNLDATE is raw TEXT value results as follows: YYYYMMDD, as follows:
I would like to calculate the week number in this case. I am aware of the DATEPART(WEEK, GetDate()) function, but just dont understand how it is formatted into my query. Also, I would like it if the week starts on a THURSDAY as opposed to another day of the week.
My current view is as follows:
SELECT dbo.GLPOST.ACCTID, dbo.GLPOST.FISCALYR, dbo.GLPOST.FISCALPERD,
dbo.GLPOST.BATCHNBR, dbo.GLPOST.ENTRYNBR, dbo.GLPOST.TRANSNBR, dbo.GLPOST.JNLDTLDESC, dbo.GLPOST.TRANSAMT, dbo.vw_Accounts.ACSEGVAL02 AS STORE, dbo.GLPOST.JRNLDATE,
dbo.vw_Accounts.ACSEGVAL01 AS ACCT
FROM dbo.GLPOST INNER JOIN
dbo.vw_Accounts ON dbo.GLPOST.ACCTID = dbo.vw_Accounts.ACCTID
WHERE (dbo.vw_Accounts.ACSEGVAL01 = '3000')
How to i add the additional field without screwing everything up.