Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

SQL to LING Convert

Select * from STK_Trans where STORETO =2199 and STOREFR = 2199 and TRANSDT BETWEEN ’01/01/2023′ AND ’01/05/2023′
Can anyone convert this sql comment to linq.

` from u in db.STK_Trans
                        where u.STORETO == stto &&
                        u.STOREFR == stid &&
                       (u.TRANSDT >= datefrom &&
                        u.TRANSDT <= dateto) select u;`

I use this but not working

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

Something like this maybe:

var query = from u in db.STK_Trans
            where u.STORETO == 2199 &&
                  u.STOREFR == 2199 &&
                  u.TRANSDT >= new DateTime(2023, 1, 1) &&
                  u.TRANSDT <= new DateTime(2023, 1, 5)
            select u;
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading