1 (edited by nrmuduli 2016-12-22 07:05:14)

Topic: WHATS WRONG! CAN NOT DISPLAY VALUES

i have two tables STCL & STCL_Board as follows

[STCL]
isdictionary=0
>id_STCL_BOARD=STCL_BOARD
_NAMERTN=TEXT
_STCL_NXTDD=DATE


[STCL_BOARD]
isdictionary=0
_BOARD=TEXT
_REMARKS=TEXT


i made a sql query as follows to get data for the current month as:

SELECT * FROM STCL
INNER JOIN STCL_BOARD ON STCL.ID =STCL_BOARD.BOARD
WHERE STCL_NXTDD BETWEEN date('now','start of month')AND date('now','start of month','+1 month','-1 day')

when i delete inner join results came out but with inner join it shows nothing with same data

i don't want to use date picker & search option.

pls. help

Re: WHATS WRONG! CAN NOT DISPLAY VALUES

try this
INNER JOIN STCL_BOARD ON STCL.ID_STCL_BOARD =STCL_BOARD.ID

3 (edited by nrmuduli 2016-12-22 09:31:45)

Re: WHATS WRONG! CAN NOT DISPLAY VALUES

bemorhona-qt wrote:

try this
INNER JOIN STCL_BOARD ON STCL.ID_STCL_BOARD =STCL_BOARD.ID

This displays id of the stcl_board not the value.
also attached file for reference
refresh button has sql script

Post's attachments

Attachment icon STCL.zip 347.62 kb, 573 downloads since 2016-12-22 

Re: WHATS WRONG! CAN NOT DISPLAY VALUES

Hi Nrmuduli,
My sql is perhaps a bit different to yours but is this any help?
Derek.

Post's attachments

Attachment icon nrmuduli.zip 353.27 kb, 628 downloads since 2016-12-22 

Re: WHATS WRONG! CAN NOT DISPLAY VALUES

derek wrote:

Hi Nrmuduli,
My sql is perhaps a bit different to yours but is this any help?
Derek.


hii derek,

exactly what i need. this helps me a lot.

many thanks

Re: WHATS WRONG! CAN NOT DISPLAY VALUES

Hi,
Glad it helped.
I should also have mentioned that if you want the dates that you retrieve in your sql query to be in the same format as those in your other tablegrid, you will need to amend your sql query to something like this

  strftime('%d-%m-%Y',stcl.stcl_ldd),
  strftime('%d-%m-%Y',stcl.stcl_compdt),
  strftime('%d-%m-%Y',stcl.stcl_nxtdd),

Regards,
Derek.

Re: WHATS WRONG! CAN NOT DISPLAY VALUES

Thanks derek....