tdignan87
Well-known member
- Joined
- Jul 8, 2019
- Messages
- 95
- Programming Experience
- Beginner
Hi i am having issues trying to look at a TIMESTAMP data type to only see if records within last hour, Example of code below: Any ideas?
So AV_TRANSACTIONS.ANSWERTIMESTAMP is the timestamp table format in the DB.
Need to convert TIMESTAMP i guess
Thanks
Tom
C#:
DateTime hourDate = DateTime.Now.AddHours(-1);
FbDataAdapter sqlFB = new FbDataAdapter(" Select AV_TRANSACTIONS.QUESTION,AV_TRANSACTIONS.QUESTIONTIMESTAMP,AV_TRANSACTIONS.ANSWERTIMESTAMP,AV_TRANSACTIONS.ANSWER,USERS.NAME As OPERATOR,TERMINALS.NAME, " +
"COMMODITIES.CODE As PRODUCT From (TERMINALS TERMINALS Inner Join (USERS USERS Inner Join AV_TRANSACTIONS AV_TRANSACTIONS On USERS.USERID = AV_TRANSACTIONS.USER_ID) On TERMINALS.TERMINALID =" +
"AV_TRANSACTIONS.TERMINAL_ID) Inner Join (COMMODITIES COMMODITIES Inner Join PRODUCEDH PRODUCEDH On COMMODITIES.COMMODITYID = PRODUCEDH.COMMODITYID) On AV_TRANSACTIONS.BATCH_ID = PRODUCEDH.BATCHID " +
"Where AV_TRANSACTIONS.QUESTION = 'CCP1: Metal detection test pass/fail?' And AV_TRANSACTIONS.ANSWER = 'Fail' And AV_TRANSACTIONS.ANSWERTIMESTAMP > " + hourDate + "", db);
So AV_TRANSACTIONS.ANSWERTIMESTAMP is the timestamp table format in the DB.
Need to convert TIMESTAMP i guess
Thanks
Tom