Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

sql question

  • 04-01-2004 3:20pm
    #1
    Registered Users, Registered Users 2 Posts: 2,621 ✭✭✭


    I'm trying to delete rows from two dbs, using ASP.NET and VB and an access db. I want to delete rows where the lastlogindate is 60 days previous to the current date. Any ideas?


    Dim queryString As String = "DELETE FROM users, CCard WHERE users.userid = ccard.id and LastLogindate < datetime.now"


Comments

  • Registered Users, Registered Users 2 Posts: 7,468 ✭✭✭Evil Phil


    Is datetime.now an Access function? Maybe the code should be
    Dim queryString As String = "DELETE FROM users, CCard WHERE
     users.userid = ccard.id and LastLogindate < " & datetime.now()
    


  • Registered Users, Registered Users 2 Posts: 15,443 ✭✭✭✭bonkey


    I don't think Access allows you to delete from two tables with one query. I know its definitely not part of the SQL standards.

    jc


  • Registered Users, Registered Users 2 Posts: 437 ✭✭Spunj


    Far as I remember, Access allows Cascading deletes so all you have to do is delete the row from the parent table (users) and the corresponding child row will also be deleted.

    You need to set up a Primary/Foreign Key relationship and theres a checkbox there which lets you specify whether or not to use Cascading deletes/updates.


Advertisement